|
41 | 41 | body-includes: "<!-- pr-comment -->" |
42 | 42 |
|
43 | 43 | # If 'pr' workflow run was 'requested'... |
44 | | - - if: github.event.action == 'requested' |
| 44 | + - if: github.event.action == 'requested' && steps.find-comment.outputs.comment-id != '' |
45 | 45 | name: PR workflow started - Update Comment |
46 | 46 | uses: peter-evans/create-or-update-comment@v5 |
47 | 47 | with: |
|
52 | 52 | <!-- pr-comment --> |
53 | 53 | Waiting for [build job](https://github.com/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}) (at ${{ github.event.workflow_run.head_sha }})... |
54 | 54 |
|
55 | | - # If 'pr' workflow run was 'completed'... |
56 | | - - if: github.event.action == 'completed' |
| 55 | + # If 'pr' workflow run was 'completed' (but not 'cancelled', that usually means a new job is |
| 56 | + # running, and we don't want to race with it)... |
| 57 | + - if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'cancelled' |
57 | 58 | name: PR workflow completed - Download pr-comment-body.txt |
58 | 59 | uses: actions/download-artifact@v4 |
59 | 60 | continue-on-error: true |
|
62 | 63 | repository: ${{ github.event.workflow_run.repository.full_name }} |
63 | 64 | run-id: ${{ github.event.workflow_run.id }} |
64 | 65 | name: pr-comment-body.txt |
65 | | - - if: github.event.action == 'completed' |
| 66 | + - if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'cancelled' |
66 | 67 | name: PR workflow completed - Create pr-comment.txt |
67 | 68 | env: |
68 | 69 | REPO: ${{github.repository}} |
|
84 | 85 | echo '(No pr-comment-body.txt artifact found from this job.)' |
85 | 86 | fi |
86 | 87 | ) > pr-comment.txt |
87 | | - - if: github.event.action == 'completed' |
88 | | - name: PR workflow completed - Update Comment |
| 88 | + - if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'cancelled' |
| 89 | + name: PR workflow completed - Post or Update Comment |
89 | 90 | uses: peter-evans/create-or-update-comment@v5 |
90 | 91 | with: |
91 | 92 | issue-number: ${{ steps.pr-context.outputs.number }} |
|
0 commit comments