From 397d10c5c4f749e55f4e5740b8094936c82196c9 Mon Sep 17 00:00:00 2001 From: agobrech Date: Mon, 22 May 2023 14:36:28 +0200 Subject: [PATCH] Update to different slack action --- .github/payloadSlack.json | 29 ++++++++++++++++++++++++++++ .github/workflows/test-workflows.yml | 10 +++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .github/payloadSlack.json diff --git a/.github/payloadSlack.json b/.github/payloadSlack.json new file mode 100644 index 0000000000..7a7c3fccf6 --- /dev/null +++ b/.github/payloadSlack.json @@ -0,0 +1,29 @@ +{ + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": " 🛑 Test Workflow Failed 🛑", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}| Test Workflow > for `${{github.event.pull_request.title}}`" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ steps.tests.outputs.slackMessage}}" + } + } + ] +} diff --git a/.github/workflows/test-workflows.yml b/.github/workflows/test-workflows.yml index ab3776f972..bdf30ab67b 100644 --- a/.github/workflows/test-workflows.yml +++ b/.github/workflows/test-workflows.yml @@ -81,10 +81,10 @@ jobs: SKIP_STATISTICS_EVENTS: true - name: Notify Slack on failure - uses: act10ns/slack@v2.0.0 + uses: slackapi/slack-github-action@v1.24.0 if: failure() + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} with: - status: ${{ job.status }} - channel: '#updates-build-alerts-test' - webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} - # message: ${{ steps.tests.outputs.slackMessage}} / (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + payload-file-path: '../payloadSlack.json' + channel-id: '#updates-build-alerts-test'