From a08ef2558fde2084cf9a8cb397aa939668d3a573 Mon Sep 17 00:00:00 2001 From: Pawel Podhajski <106311100+pw-ppodhajski@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:22:53 +0100 Subject: [PATCH] ci(actions): fix slack alert (#7692) GitOrigin-RevId: 0da6646c72980381e3de376adad19b49238e8b53 --- .github/workflows/package_test.yml | 6 ++---- .github/workflows/release.yml | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/package_test.yml b/.github/workflows/package_test.yml index b9487b41..e60db938 100644 --- a/.github/workflows/package_test.yml +++ b/.github/workflows/package_test.yml @@ -129,14 +129,14 @@ jobs: id: slack uses: slackapi/slack-github-action@v2.0.0 with: - # For posting a simple plain text message + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: webhook-trigger payload: | { "text": "Repository: ${{ github.repository }}\nAction name: ${{ github.workflow }}\nGitHub Action test: failure :manul:\nPR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nAction run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nPR Author: ${{ github.actor }}", "blocks": [ { "type": "section", - "channel": ${{ secrets.SLACK_CI_ALERT }}, "text": { "type": "mrkdwn", "text": "Repository: ${{ github.repository }}\nAction name: ${{ github.workflow }}\nGitHub Action test: failure :manul:\nPR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nAction run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nPR Author: ${{ github.actor }}" @@ -144,5 +144,3 @@ jobs: } ] } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e85956f9..067d114f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -393,13 +393,14 @@ jobs: id: slack uses: slackapi/slack-github-action@v2.0.0 with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: webhook-trigger payload: | { "text": "GitHub Action build result: failure :manul:\nPR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nAction run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nPR Author: ${{ github.event.pull_request.user.login }}", "blocks": [ { "type": "section", - "channel": ${{ secrets.SLACK_CI_ALERT }}, "text": { "type": "mrkdwn", "text": "GitHub Action build result: failure :manul:\nPR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nAction run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nPR Author: ${{ github.event.pull_request.user.login }}" @@ -407,5 +408,3 @@ jobs: } ] } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}