From d16d98cbc4d6afe89f49503f967328259a0dc70a Mon Sep 17 00:00:00 2001 From: Ramon Navarro Bosch Date: Mon, 19 Feb 2024 12:50:37 +0100 Subject: [PATCH] Fix notifications to slack --- .github/workflows/run-e2e-nua-prod.yml | 17 ++++++++++------- .github/workflows/run-e2e-nua-stage.yml | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run-e2e-nua-prod.yml b/.github/workflows/run-e2e-nua-prod.yml index e222d8b..3bafb1d 100644 --- a/.github/workflows/run-e2e-nua-prod.yml +++ b/.github/workflows/run-e2e-nua-prod.yml @@ -41,12 +41,15 @@ jobs: with: report_paths: 'nua.xml' - - name: Discord notification - uses: cl8dep/action-discord@0.1 + - name: Slack notification + id: slack + uses: slackapi/slack-github-action@v1.24.0 if: ${{ failure() && github.ref_name == 'main' }} with: - webhook: ${{ secrets.NUA_E2E_SLACK_WEBHOOK }} - message: | - ⚠️ tests failed @NUA - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> - username: 'NUA E2E' \ No newline at end of file + payload: | + { + "text": "⚠️ tests failed\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.NUA_E2E_SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file diff --git a/.github/workflows/run-e2e-nua-stage.yml b/.github/workflows/run-e2e-nua-stage.yml index 15395e1..af731ef 100644 --- a/.github/workflows/run-e2e-nua-stage.yml +++ b/.github/workflows/run-e2e-nua-stage.yml @@ -43,12 +43,15 @@ jobs: with: report_paths: 'nua.xml' - - name: Discord notification - uses: cl8dep/action-discord@0.1 + - name: Slack notification + id: slack + uses: slackapi/slack-github-action@v1.24.0 if: ${{ failure() && github.ref_name == 'main' }} with: - webhook: ${{ secrets.NUA_E2E_SLACK_WEBHOOK }} - message: | - ⚠️ tests failed @NUA - <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> - username: 'NUA E2E' \ No newline at end of file + payload: | + { + "text": "⚠️ tests failed\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.NUA_E2E_SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file