From ec56b8743ea7d7a06fe2c48d35858a9cc0c45bf7 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 25 Sep 2024 10:31:06 +0200 Subject: [PATCH 1/4] feat(updatedMessage): remove activate-pm2 reference --- .github/workflows/test-slack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-slack.yml b/.github/workflows/test-slack.yml index 97d1f47..cc4ebff 100644 --- a/.github/workflows/test-slack.yml +++ b/.github/workflows/test-slack.yml @@ -29,13 +29,13 @@ jobs: notify-end: if: always() name: Notify release end - needs: [ notify-start, activate-pm2 ] + needs: [ notify-start, release ] uses: ho-nl/release-slack-action/.github/workflows/notify-slack-end.yml@main secrets: slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN}} with: time: ${{ needs.notify-start.outputs.time }} - result: ${{ needs.activate-pm2.result }} + result: ${{ needs.release.result }} channel: 12gobiking-test message: Test notifyOnlyOnFailure: false From b58dcca0e96ad2c146de27e30f6692237e501579 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 25 Sep 2024 10:42:32 +0200 Subject: [PATCH 2/4] feat(updatedMessage): updated test-slack.yml to use the actions of current branch instead of the main branch --- .github/workflows/test-slack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-slack.yml b/.github/workflows/test-slack.yml index cc4ebff..034aadc 100644 --- a/.github/workflows/test-slack.yml +++ b/.github/workflows/test-slack.yml @@ -10,7 +10,7 @@ concurrency: jobs: notify-start: name: Notify release start - uses: ho-nl/release-slack-action/.github/workflows/notify-slack-start.yml@main + uses: ./.github/workflows/notify-slack-start.yml secrets: slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN}} with: @@ -30,7 +30,7 @@ jobs: if: always() name: Notify release end needs: [ notify-start, release ] - uses: ho-nl/release-slack-action/.github/workflows/notify-slack-end.yml@main + uses: ./.github/workflows/notify-slack-end.yml secrets: slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN}} with: From bfe5ffd187f94ced5485d45c408d97e0653c8a99 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 25 Sep 2024 10:47:32 +0200 Subject: [PATCH 3/4] feat(updatedMessage): use html_url to retrieve the correct page instead of the api endpoint --- .github/workflows/notify-slack-end.yml | 2 +- .github/workflows/notify-slack-start.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify-slack-end.yml b/.github/workflows/notify-slack-end.yml index f472cfa..2fcf7d6 100644 --- a/.github/workflows/notify-slack-end.yml +++ b/.github/workflows/notify-slack-end.yml @@ -50,7 +50,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)" + "text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* \n <${{ github.event.repository.html_url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} | open>)" } }, { diff --git a/.github/workflows/notify-slack-start.yml b/.github/workflows/notify-slack-start.yml index 6bf4aae..ce667e9 100644 --- a/.github/workflows/notify-slack-start.yml +++ b/.github/workflows/notify-slack-start.yml @@ -48,7 +48,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* 🚀 \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)" + "text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* 🚀 \n <${{ github.event.repository.html_url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} | open>)" } }, { From dca9fcf55dee2459afc95fdb226975cd25c0c60e Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 25 Sep 2024 12:05:45 +0200 Subject: [PATCH 4/4] feat(updatedMessage): add Cancelled to status on slack message --- .github/workflows/notify-slack-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify-slack-end.yml b/.github/workflows/notify-slack-end.yml index 2fcf7d6..8b4fe51 100644 --- a/.github/workflows/notify-slack-end.yml +++ b/.github/workflows/notify-slack-end.yml @@ -58,7 +58,7 @@ jobs: "elements": [ { "type": "plain_text", - "text": "${{ inputs.result == 'success' && 'Success' || 'Failure' }} after ${{ env.parsed_time }}", + "text": "${{ inputs.result == 'success' && 'Success' || inputs.result == 'cancelled' && 'Cancelled' || 'Failure' }} after ${{ env.parsed_time }}", "emoji": true } ]