Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Use a repository_dispatch event to trigger autograding
Browse files Browse the repository at this point in the history
  • Loading branch information
smashwilson committed May 28, 2024
1 parent f672636 commit 5ec996e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/0-welcome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 15 additions & 0 deletions .github/workflows/1-copilot-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 15 additions & 0 deletions .github/workflows/2-skills-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 15 additions & 0 deletions .github/workflows/3-copilot-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 15 additions & 0 deletions .github/workflows/4-copilot-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 5ec996e

Please sign in to comment.