From 566b09ff208feb6625ec4a52324f1b9f8770eac0 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 17 Oct 2023 20:36:24 +0900 Subject: [PATCH] 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. --- .github/workflows/diffcalc.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/diffcalc.yml b/.github/workflows/diffcalc.yml index d39dffc4b9..a8dc16af15 100644 --- a/.github/workflows/diffcalc.yml +++ b/.github/workflows/diffcalc.yml @@ -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.