Skip to content

Commit 87b8d4e

Browse files
committed
Make slack notification message conditional on job status
1 parent 21872e9 commit 87b8d4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/release-packages.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
SLACK_COLOR: ${{ job.status }}
8080
SLACK_USERNAME: Github Actions CI bot
8181
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
82-
SLACK_MESSAGE: 'Ubuntu 20.04 package built and uploaded successfully'
82+
SLACK_MESSAGE: "${{ job.status == 'success' && 'Ubuntu 20.04 package built and uploaded successfully' || 'Ubuntu 20.04 package build failed' }}"
8383

8484
ubuntu-18_04-package:
8585
runs-on: ubuntu-18.04
@@ -167,7 +167,7 @@ jobs:
167167
SLACK_COLOR: ${{ job.status }}
168168
SLACK_USERNAME: Github Actions CI bot
169169
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
170-
SLACK_MESSAGE: 'Ubuntu 18.04 package built and uploaded successfully'
170+
SLACK_MESSAGE: "${{ job.status == 'success' && 'Ubuntu 18.04 package built and uploaded successfully' || 'Ubuntu 18.04 package build failed' }}"
171171

172172

173173
homebrew-pr:
@@ -320,4 +320,4 @@ jobs:
320320
SLACK_COLOR: ${{ job.status }}
321321
SLACK_USERNAME: Github Actions CI bot
322322
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
323-
SLACK_MESSAGE: 'Docker Image built and submitted to DockerHub successfully'
323+
SLACK_MESSAGE: "${{ job.status == 'success' && 'Docker Image built and submitted to DockerHub successfully' || 'Docker Image build failed' }}"

0 commit comments

Comments
 (0)