github-education-resources / Series-Intro-to-GitHub-Flow

MIT License
13 stars 115 forks source link

Trigger autograding with repository_dispatch #12

Closed smashwilson closed 4 months ago

smashwilson commented 4 months ago

Port over the autograding fix from https://github.com/education/primer-copilot/pull/12.

Tasks performed by the GitHub Actions GITHUB_TOKEN, such as commit pushes, do not create new workflow runs. This means that the commit and push performed by our skills/action-update-step@v2 steps are not triggering GitHub Classroom's autograding workflow, which in turn is preventing learners from having their Experience marked as complete after they finish the final step.

The autograding workflow is created with a repository_dispatch trigger. This modifies our Actions workflows to manually create a repository_dispatch event on the repository after the step update commit has been pushed, causing autograding to run after the -step.txt file has received its final update, at which point it will be able to succeed.