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

Commit

Permalink
Merge pull request #12 from education/autograding-trigger
Browse files Browse the repository at this point in the history
Trigger autograding with repository_dispatch
  • Loading branch information
smashwilson authored May 29, 2024
2 parents ce03de7 + 63cb2ab commit d413be7
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 @@ -64,3 +64,18 @@ jobs:
branch_name: my-first-branch
env:
GITHUB_TOKEN: ${{ secrets.GLOBAL_CLASSROOM_ORG_TOKEN }}

# 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-create-a-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ jobs:
from_step: 1
to_step: 2
branch_name: my-first-branch

# 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-commit-a-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ jobs:
from_step: 2
to_step: 3
branch_name: my-first-branch

# 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-open-a-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,18 @@ jobs:
from_step: 3
to_step: 4
branch_name: my-first-branch

# 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-merge-your-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ jobs:
from_step: 4
to_step: X
branch_name: my-first-branch

# 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 d413be7

Please sign in to comment.