From 0340bd47891c2f250feab01f7d1165425c6f95ce Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 21 Nov 2024 10:39:49 -0500 Subject: [PATCH 1/2] .github/workflows: fix slack feed webhook secret name Replaces the secret name with the correct value of `FEED_SLACK_WEBHOOK_NAME`. --- .github/workflows/comments-feed.yml | 2 +- .github/workflows/pull_request_feed.yml | 6 +++--- .github/workflows/pull_request_review.yml | 2 +- .github/workflows/release-tag.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/comments-feed.yml b/.github/workflows/comments-feed.yml index 30d19919ea0..67a0678e83d 100644 --- a/.github/workflows/comments-feed.yml +++ b/.github/workflows/comments-feed.yml @@ -35,7 +35,7 @@ jobs: ISSUE_URL: ${{ github.event.issue.html_url }} ISSUE_TITLE: ${{ github.event.issue.title }} with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { diff --git a/.github/workflows/pull_request_feed.yml b/.github/workflows/pull_request_feed.yml index 47feae911c5..e266324bc52 100644 --- a/.github/workflows/pull_request_feed.yml +++ b/.github/workflows/pull_request_feed.yml @@ -36,7 +36,7 @@ jobs: MERGED_BY_URL: ${{ github.event.pull_request.merged_by.html_url }} MERGED_BY_LOGIN: ${{ github.event.pull_request.merged_by.login }} with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { @@ -61,7 +61,7 @@ jobs: PR_AUTHOR_URL: ${{ github.event.pull_request.user.html_url }} PR_AUTHOR_LOGIN: ${{ github.event.pull_request.user.login }} with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { @@ -85,7 +85,7 @@ jobs: PR_AUTHOR_URL: ${{ github.event.pull_request.user.html_url }} PR_AUTHOR_LOGIN: ${{ github.event.pull_request.user.login }} with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { diff --git a/.github/workflows/pull_request_review.yml b/.github/workflows/pull_request_review.yml index 6e4c9b56d66..4f6c4ee6564 100644 --- a/.github/workflows/pull_request_review.yml +++ b/.github/workflows/pull_request_review.yml @@ -35,7 +35,7 @@ jobs: PR_HTML_URL: ${{ github.event.pull_request.html_url }} PR_TITLE: ${{ github.event.pull_request.title }} with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 081696ebcfa..ef60bb4f23d 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -11,7 +11,7 @@ jobs: id: slack uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.FEED_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | { From d8cda590806c50a1c0541ca890d7566c46f40422 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 21 Nov 2024 10:53:26 -0500 Subject: [PATCH 2/2] .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",