From 38efbcb1bbc1e1c293ea93f90dd82808564a2c5f Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 25 Nov 2024 19:25:30 +0400 Subject: [PATCH] fix: slack notify job Things changed for v2 plugin. Signed-off-by: Andrey Smirnov --- .github/workflows/slack-notify.yaml | 7 +++---- internal/output/ghworkflow/files/slack-notify-payload.json | 1 + internal/output/ghworkflow/gh_workflow.go | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/slack-notify.yaml b/.github/workflows/slack-notify.yaml index a8f8fcab..3ea66e90 100644 --- a/.github/workflows/slack-notify.yaml +++ b/.github/workflows/slack-notify.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-11-25T08:20:41Z by kres b3b0da7-dirty. +# Generated on 2024-11-25T15:24:43Z by kres b9ed228-dirty. name: slack-notify "on": @@ -26,9 +26,9 @@ jobs: - name: Slack Notify uses: slackapi/slack-github-action@v2 with: - channel-id: proj-talos-maintainers payload: | { + "channel": "proj-talos-maintainers", "attachments": [ { "color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}", @@ -88,5 +88,4 @@ jobs: } ] } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + token: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/internal/output/ghworkflow/files/slack-notify-payload.json b/internal/output/ghworkflow/files/slack-notify-payload.json index 42c8ec3e..9588a8f3 100644 --- a/internal/output/ghworkflow/files/slack-notify-payload.json +++ b/internal/output/ghworkflow/files/slack-notify-payload.json @@ -1,4 +1,5 @@ { + "channel": "proj-talos-maintainers", "attachments": [ { "color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}", diff --git a/internal/output/ghworkflow/gh_workflow.go b/internal/output/ghworkflow/gh_workflow.go index bee53d12..3bf31025 100644 --- a/internal/output/ghworkflow/gh_workflow.go +++ b/internal/output/ghworkflow/gh_workflow.go @@ -134,8 +134,7 @@ func NewOutput(mainBranch string, withDefaultJob bool) *Output { SetCustomCondition("github.event.workflow_run.event == 'pull_request'"), Step("Slack Notify"). SetUses("slackapi/slack-github-action@"+config.SlackNotifyActionVersion). - SetEnv("SLACK_BOT_TOKEN", "${{ secrets.SLACK_BOT_TOKEN }}"). - SetWith("channel-id", "proj-talos-maintainers"). + SetWith("token", "${{ secrets.SLACK_BOT_TOKEN }}"). SetWith("payload", slackNotifyPayload), }, },