@@ -75,76 +75,21 @@ jobs:
7575 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7676
7777 finish_exercise :
78- name : Finish exercise
78+ name : Finish Exercise
79+ needs : [find_exercise, post_review_content]
80+ uses :
skills/exercise-toolkit/.github/workflows/[email protected] 81+ with :
82+ issue-url : ${{ needs.find_exercise.outputs.issue-url }}
83+
84+ disable_workflow :
85+ name : Disable this workflow
7986 needs : [find_exercise, post_review_content]
8087 runs-on : ubuntu-latest
81- env :
82- ISSUE_URL : ${{ needs.find_exercise.outputs.issue-url }}
8388
8489 steps :
8590 - name : Checkout
8691 uses : actions/checkout@v4
87- with :
88- ref : main
89-
90- - name : Get response templates
91- uses : actions/checkout@v4
92- with :
93- repository : skills/response-templates
94- path : skills-response-templates
95-
96- - name : Configure Git user
97- run : |
98- git config user.name github-actions[bot]
99- git config user.email github-actions[bot]@users.noreply.github.com
100-
101- - name : Build message - congratulations
102- id : build-message-congratulations
103- uses : skills/action-text-variables@v1
104- with :
105- template-file : skills-response-templates/readme/congratulations.md
106- template-vars : |
107- login=${{ github.actor }}
108-
109- - name : Update README - congratulations
110- run : |
111- # Add "Congratulations" to the start of the README
112- orig_readme=$(cat README.md)
113- new_readme="${{ steps.build-message-congratulations.outputs.updated-text }} $orig_readme"
114-
115- # Update file and push
116- echo "$new_readme" > README.md
117- git add README.md
118- git commit --message="Congratulations!🎉"
119- git push
120- env :
121- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122-
123- - name : Build message - exercise finished
124- id : build-finish-message
125- uses : skills/action-text-variables@v1
126- with :
127- template-file : skills-response-templates/step-feedback/lesson-finished.md
128- template-vars : |
129- login=${{ github.actor }}
130- repo_full_name=${{ github.repository }}
131-
132- - name : Create comment - exercise finished
133- run : |
134- gh issue comment "$ISSUE_URL" \
135- --body "$ISSUE_BODY"
136- env :
137- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
138- ISSUE_BODY : ${{ steps.build-finish-message.outputs.updated-text }}
139-
140- - name : Close issue
141- run : gh issue close "$ISSUE_URL"
142- env :
143- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
144-
14592 - name : Disable current workflow
146- run : |
147- gh workflow disable "Step 4"
148- gh workflow disable "Step 4b"
93+ run : gh workflow disable "${{github.workflow}}"
14994 env :
15095 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments