diff --git a/.github/workflows/0-welcome.yml b/.github/workflows/0-welcome.yml index eb52233..66aa326 100644 --- a/.github/workflows/0-welcome.yml +++ b/.github/workflows/0-welcome.yml @@ -54,3 +54,18 @@ jobs: token: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }} from_step: 0 to_step: 1 + + # Commits pushed by an Action will not create a new workflow run. To work + # around this, create a repository_dispatch event to ensure that GitHub + # Classroom's autograding workflow runs on the commit created by + # skills/action-update-step. + # Reference: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow + - name: Trigger autograding workflow + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/dispatches" \ + -f "event_type=autograde" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/1-copilot-extension.yml b/.github/workflows/1-copilot-extension.yml index 1665552..7314d8d 100644 --- a/.github/workflows/1-copilot-extension.yml +++ b/.github/workflows/1-copilot-extension.yml @@ -67,3 +67,18 @@ jobs: token: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }} from_step: 1 to_step: 2 + + # Commits pushed by an Action will not create a new workflow run. To work + # around this, create a repository_dispatch event to ensure that GitHub + # Classroom's autograding workflow runs on the commit created by + # skills/action-update-step. + # Reference: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow + - name: Trigger autograding workflow + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/dispatches" \ + -f "event_type=autograde" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/2-skills-javascript.yml b/.github/workflows/2-skills-javascript.yml index 7e0533f..de4d358 100644 --- a/.github/workflows/2-skills-javascript.yml +++ b/.github/workflows/2-skills-javascript.yml @@ -69,3 +69,18 @@ jobs: token: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }} from_step: 2 to_step: 3 + + # Commits pushed by an Action will not create a new workflow run. To work + # around this, create a repository_dispatch event to ensure that GitHub + # Classroom's autograding workflow runs on the commit created by + # skills/action-update-step. + # Reference: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow + - name: Trigger autograding workflow + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/dispatches" \ + -f "event_type=autograde" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/3-copilot-hub.yml b/.github/workflows/3-copilot-hub.yml index b7b4cd7..061a6a8 100644 --- a/.github/workflows/3-copilot-hub.yml +++ b/.github/workflows/3-copilot-hub.yml @@ -69,3 +69,18 @@ jobs: token: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }} from_step: 3 to_step: 4 + + # Commits pushed by an Action will not create a new workflow run. To work + # around this, create a repository_dispatch event to ensure that GitHub + # Classroom's autograding workflow runs on the commit created by + # skills/action-update-step. + # Reference: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow + - name: Trigger autograding workflow + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/dispatches" \ + -f "event_type=autograde" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/4-copilot-comment.yml b/.github/workflows/4-copilot-comment.yml index 143a2d2..ae7f357 100644 --- a/.github/workflows/4-copilot-comment.yml +++ b/.github/workflows/4-copilot-comment.yml @@ -69,3 +69,18 @@ jobs: token: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }} from_step: 4 to_step: X + + # Commits pushed by an Action will not create a new workflow run. To work + # around this, create a repository_dispatch event to ensure that GitHub + # Classroom's autograding workflow runs on the commit created by + # skills/action-update-step. + # Reference: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow + - name: Trigger autograding workflow + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/dispatches" \ + -f "event_type=autograde" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}