diff --git a/.github/slack-templates/pipeline-failed.json b/.github/slack-templates/pipeline-failed.json index b8d80e6e9..d08909a3a 100644 --- a/.github/slack-templates/pipeline-failed.json +++ b/.github/slack-templates/pipeline-failed.json @@ -1,4 +1,5 @@ { + "channel": "${{ env.CHANNEL_ID }}", "attachments": [ { "color": "#FF0000", diff --git a/.github/workflows/ci-cd-pull-request-release-please.yml b/.github/workflows/ci-cd-pull-request-release-please.yml index 0900310f2..47d0a23dc 100644 --- a/.github/workflows/ci-cd-pull-request-release-please.yml +++ b/.github/workflows/ci-cd-pull-request-release-please.yml @@ -77,15 +77,16 @@ jobs: text: ${{ github.event.pull_request.body }} - name: Send GitHub slack message id: slack - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: slackapi/slack-github-action@v1.27.1 + uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID_FOR_RELEASES }} + errors: true + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | { - "blocks": [ - { + "channel": "${{ secrets.SLACK_CHANNEL_ID_FOR_RELEASES }}", + "blocks": [ + { "type": "section", "text": { "type": "mrkdwn", diff --git a/.github/workflows/workflow-send-ci-cd-status-slack-message.yml b/.github/workflows/workflow-send-ci-cd-status-slack-message.yml index 834c5d076..e03457d67 100644 --- a/.github/workflows/workflow-send-ci-cd-status-slack-message.yml +++ b/.github/workflows/workflow-send-ci-cd-status-slack-message.yml @@ -74,7 +74,7 @@ jobs: - name: Send GitHub slack message id: slack env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} ENVIRONMENT: ${{ inputs.environment }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} # statuses @@ -85,7 +85,9 @@ jobs: SCHEMA_NPM_STATUS: "${{ steps.status-emojis.outputs.SCHEMA_NPM_EMOJI }}" PUBLISH_STATUS: "${{ steps.status-emojis.outputs.PUBLISH_EMOJI }}" BUILD_AND_TEST_STATUS: "${{ steps.status-emojis.outputs.BUILD_AND_TEST_EMOJI }}" - uses: slackapi/slack-github-action@v1.27.1 + uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + errors: true + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload-templated: true payload-file-path: "./.github/slack-templates/pipeline-failed.json" \ No newline at end of file