Automated issue creation and issue close based on test results

Hey all! I’m looking for feedback with regards to my autograding workflow. I’ve recently added automated issue creation and closure, based on whether or not the student submission passes the automatic tests.

In the code below, my student’s submission is


title: Test Failure
labels: bug
assignees: $payload.sender.login

## {{ date | date("dddd, MMMM Do YYYY") }}

> Your program submission did not pass the test case(s) listed in the rubric on Canvas. 

## Find the Issue

1. Open the assignment on [Canvas]( Execute your program with the inputs listed in the rubric's test cases. Does your output match what's expected? 
    - Look closely at the formatting, punctuation, white space, and capitalization... it must match exactly.

2. Read the directions and problem statement again very closely. Did you miss any small details?

3. Re-write your algorithm from scratch before updating your program. 
    - Video: [What is psuedocode and how do you use it?](

4. Getting program execution errors? Google may be your best friend...
    - Video: [How to Debug your Code](
    - Video: [What to do when you are stuck](

5. Need help with Python?
    - [Official Tutorial](
    - [Sololearn Python Tutorial](
    - Python Video Tutorials: [1](, [2](, and [3](


name: Build and Test

      - 'src/'  
    runs-on: ubuntu-latest
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
        python-version: '3.x'
    - name: Run Tests
      run: |
        python3 -m pip install --upgrade pip
        pip install pytest flake8
        flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
        flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
        python3 -m pytest
    - name: Create Issue (if tests fail)
      if: failure()
      uses: JasonEtco/create-an-issue@v2
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        update_existing: true
        assignees: ${{ GITHUB.ACTOR }}  
    - name: Close Issue (if tests pass)
      if: success()
      uses: actions/stale@v3
        only-labels: 'bug'
        stale-issue-label: 'resolved'
        stale-issue-message: 'Student Program passes all tests. Issue is resolved'
        close-issue-message: 'Closing issue.'
        days-before-issue-stale: 0
        days-before-close: 0

Issue Tab after failing, then passing tests

1 Like

Would it be a better flow if I were to place the steps that open and close the issue in an action.yml file in the same same subfolder as the issue template? Or does that make the flow more complex? IDK