feat: Create initial version #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Step 4 | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
permissions: | |
contents: write | |
actions: write | |
issues: write | |
env: | |
REVIEW_FILE: ".github/steps/x-review.md" | |
jobs: | |
find_exercise: | |
name: Find Exercise Issue | |
uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.3.0 | |
check_step_work: | |
name: Check step work | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
needs: [find_exercise] | |
env: | |
ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get Exercise Toolkit | |
uses: actions/checkout@v4 | |
with: | |
repository: skills/exercise-toolkit | |
path: exercise-toolkit | |
ref: v0.3.0 | |
- name: Update comment - checking work | |
run: | | |
gh issue comment "$ISSUE_URL" \ | |
--body-file exercise-toolkit/markdown-templates/step-feedback/checking-work.md \ | |
--edit-last | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# START: Check practical exercise | |
# Merging the pull request is enough to finish this step | |
# END: Check practical exercise | |
- name: Update comment - step finished - final review next | |
run: | | |
gh issue comment "$ISSUE_URL" \ | |
--body-file exercise-toolkit/markdown-templates/step-feedback/lesson-review.md \ | |
--edit-last | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
post_review_content: | |
name: Post review content | |
runs-on: ubuntu-latest | |
needs: [find_exercise, check_step_work] | |
env: | |
ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create comment - add review content | |
run: | | |
gh issue comment "$ISSUE_URL" \ | |
--body-file ${{ env.REVIEW_FILE }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
finish_exercise: | |
name: Finish Exercise | |
needs: [find_exercise, post_review_content] | |
uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.3.0 | |
with: | |
issue-url: ${{ needs.find_exercise.outputs.issue-url }} | |
disable_workflow: | |
name: Disable this workflow | |
needs: [find_exercise, post_review_content] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Disable current workflow | |
run: gh workflow disable "${{github.workflow}}" || true | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |