name: Autograde Selfie Assignment

on:
  push:
    paths:
    - '**.c'
    - '**.yml'
  workflow_dispatch:
    inputs:
      assignmentid:
        description: 'Assignment ID'     
        required: true
        default: 'skip ci'

jobs:
  auto-grade-selfie-assignment:
    name: Run autograder
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    env:
      COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
      ASSIGNMENT: ${{ github.event.inputs.assignmentid }}

    steps:
    - name: Checkout selfie
      uses: actions/checkout@v2
    - name: Use Python 3.7.x
      uses: actions/setup-python@v1
      with:
        python-version: "3.7.x"
    # extract assignment from "commit message [assignment]"
    - name: Parse commit message
      run: echo "ASSIGNMENT=$(echo $COMMIT_MESSAGE | awk -F '[][]' '{print $2}')" >> $GITHUB_ENV
      if: github.event_name == 'push'
    - name: Autograde assignment
      run: if [ "$ASSIGNMENT" != 'skip ci' ]; then ./grader/self.py $ASSIGNMENT; fi
name: Autograde Selfie Assignment

on:
  push:
    paths:
    - '**.c'
    - '**.yml'
  workflow_dispatch:
    inputs:
      assignmentid:
        description: 'Assignment ID'     
        required: true
        default: 'self-compile'

jobs:
  auto-grade-selfie-assignment:
    name: Run autograder
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    env:
      COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
      ASSIGNMENT: ${{ github.event.inputs.assignmentid }}

    steps:
    - name: Checkout selfie
      uses: actions/checkout@v2
    - name: Use Python 3.7.x
      uses: actions/setup-python@v1
      with:
        python-version: "3.7.x"
    # extract assignment from "commit message [assignment]"
    - name: Parse commit message
      run: echo "ASSIGNMENT=$(echo $COMMIT_MESSAGE | awk -F '[][]' '{print $2}')" >> $GITHUB_ENV
      if: github.event_name == 'push'
    - name: Autograde assignment
      run: if [ "$ASSIGNMENT" != 'skip ci' ]; then ./grader/self.py $ASSIGNMENT; fi
Change default grading task of manual workflow dispatch to self-compile
Change default grading task of manual workflow dispatch to self-compile
