Skip to content

Commit

Permalink
fix: slack notify job
Browse files Browse the repository at this point in the history
Things changed for v2 plugin.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Nov 25, 2024
1 parent b9ed228 commit 38efbcb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/slack-notify.yaml
Original file line number Diff line number Diff line change
@@ -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":
Expand All @@ -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' }}",
Expand Down Expand Up @@ -88,5 +88,4 @@ jobs:
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
token: ${{ secrets.SLACK_BOT_TOKEN }}
1 change: 1 addition & 0 deletions internal/output/ghworkflow/files/slack-notify-payload.json
Original file line number Diff line number Diff line change
@@ -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' }}",
Expand Down
3 changes: 1 addition & 2 deletions internal/output/ghworkflow/gh_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
Expand Down

0 comments on commit 38efbcb

Please sign in to comment.