2020 uses : skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.1
2121
2222 on-opened :
23- if : github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
23+ if : ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened') }}
2424 runs-on : ubuntu-latest
2525 steps :
2626 - uses : actions/checkout@v4
3434 post_review_content :
3535 name : Post review content
3636 needs : [find_exercise]
37+ if : ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened') }}
3738 runs-on : ubuntu-latest
3839 env :
3940 ISSUE_REPOSITORY : ${{ github.repository }}
@@ -43,30 +44,24 @@ jobs:
4344 - name : Checkout
4445 uses : actions/checkout@v4
4546
46- - name : Create comment - step finished - final review next
47+ - name : Create comment, step finished, final review next
4748 uses : GrantBirki/comment@v2.1.1
4849 with :
4950 repository : ${{ env.ISSUE_REPOSITORY }}
5051 issue-number : ${{ env.ISSUE_NUMBER }}
5152 file : .github/i18n/fr/lesson-review.md
5253
53- - name : Create comment - add review content
54+ - name : Create comment, add review content
5455 uses : GrantBirki/comment@v2.1.1
5556 with :
5657 repository : ${{ env.ISSUE_REPOSITORY }}
5758 issue-number : ${{ env.ISSUE_NUMBER }}
5859 file : ${{ env.REVIEW_FILE }}
5960
60- - name : Disable current workflow
61- run : gh workflow disable ".github/workflows/3-last-step.yml"
62- env :
63- GH_TOKEN : ${{ github.token }}
64- continue-on-error : true
65-
6661 finish_exercise :
6762 name : Finish Exercise
68- needs : [find_exercise, post_review_content ]
69- if : github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
63+ needs : [find_exercise]
64+ if : ${{ github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true }}
7065 uses : skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.7.1
7166 with :
7267 issue-url : ${{ needs.find_exercise.outputs.issue-url }}
@@ -75,10 +70,12 @@ jobs:
7570
7671 finalize_fr :
7772 name : Finalize FR
78- needs : [find_exercise, post_review_content, finish_exercise]
73+ needs : [find_exercise, finish_exercise]
74+ if : ${{ github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true }}
7975 runs-on : ubuntu-latest
8076 env :
8177 ISSUE_NUMBER : ${{ needs.find_exercise.outputs.issue-number }}
78+
8279 steps :
8380 - name : Checkout
8481 uses : actions/checkout@v4
@@ -192,3 +189,15 @@ jobs:
192189 } else {
193190 await github.rest.issues.createComment({ owner, repo, issue_number, body });
194191 }
192+
193+ disable_step3 :
194+ name : Disable Step 3
195+ needs : [finalize_fr]
196+ if : ${{ github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true }}
197+ runs-on : ubuntu-latest
198+ steps :
199+ - name : Disable workflow file
200+ run : gh workflow disable ".github/workflows/3-last-step.yml"
201+ env :
202+ GH_TOKEN : ${{ github.token }}
203+ continue-on-error : true
0 commit comments