Delete comment on cancellation

- Add always() pre-condition to force evaluation.

- Message is set as it's required by the action for a non-error status code.
This commit is contained in:
Dan Balasescu 2023-10-17 20:36:24 +09:00
parent 08845ec1c6
commit 566b09ff20
No known key found for this signature in database
1 changed files with 9 additions and 1 deletions

View File

@ -352,7 +352,7 @@ jobs:
name: Update PR comment
needs: [ create-comment, generator ]
runs-on: ubuntu-latest
if: ${{ needs.create-comment.result == 'success' }}
if: ${{ always() && needs.create-comment.result == 'success' }}
steps:
- name: Update comment on success
if: ${{ needs.generator.result == 'success' }}
@ -374,3 +374,11 @@ jobs:
create_if_not_exists: false
message: |
Difficulty calculation failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Update comment on cancellation
if: ${{ needs.generator.result == 'cancelled' }}
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: ${{ env.COMMENT_TAG }}
mode: delete
message: '.' # Appears to be required by this action for non-error status code.