From d8cda590806c50a1c0541ca890d7566c46f40422 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 21 Nov 2024 10:53:26 -0500 Subject: [PATCH] .github/workflows: address slack API method style breaking changes These workflows were incorrectly updated during the first round of attempted changes, as they are actually the "Slack API Method" technique, not "Slack incoming webhook". The changes include: - explicitly setting the `method` to `chat.PostMessage` - passing the token in the `token` argument, rather than the `SLACK_BOT_TOKEN` environment variable - sending the channel directly in the `payload`, rather than using the `channel-id` argument --- .github/workflows/label-notifications.yml | 7 +++---- .github/workflows/post_publish.yml | 8 +++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/label-notifications.yml b/.github/workflows/label-notifications.yml index 76f821eddb3..12d64ca02ab 100644 --- a/.github/workflows/label-notifications.yml +++ b/.github/workflows/label-notifications.yml @@ -24,13 +24,12 @@ jobs: uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 env: ISSUE_TITLE: ${{ toJSON(github.event.issue.title || github.event.pull_request.title) }} - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} with: - channel-id: ${{ secrets.SLACK_CHANNEL }} - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - webhook-type: incoming-webhook + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | { + "channel" : "${{ secrets.SLACK_CHANNEL }}", "blocks": [ { "type": "section", diff --git a/.github/workflows/post_publish.yml b/.github/workflows/post_publish.yml index 93d8886952a..2b413eef138 100644 --- a/.github/workflows/post_publish.yml +++ b/.github/workflows/post_publish.yml @@ -107,14 +107,12 @@ jobs: - name: Send Slack Notification Upon Failure if: ${{ failure() }} uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} with: - channel-id: ${{ secrets.SLACK_CHANNEL }} - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - webhook-type: incoming-webhook + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | { + "channel" : "${{ secrets.SLACK_CHANNEL }}", "blocks": [ { "type": "section",