Bitbucket Pipelines pipe to send a notification to Slack on non-zero exit code
50K+
Inspired by Slack Notify by Atlassian. Sends a custom notification to Slack on non-zero BITBUCKET_EXIT_CODE.
Add the following snippet to the script section of your bitbucket-pipelines.yml file:
- pipe: rhendricksen/slack-notify-on-fail:1.0.0
variables:
WEBHOOK_URL: '<string>'
MESSAGE: '<string>'
# DEBUG: '<boolean>' # Optional.
| Variable | Usage |
|---|---|
| WEBHOOK_URL (*) | Incoming Webhook URL. It is recommended to use a secure repository variable. |
| MESSAGE (*) | Notification message. |
| DEBUG | Turn on extra debug information. Default: false. |
(*) = required variable.
To send notifications to Slack, you need an Incoming Webhook URL. You can follow the instructions here to create one.
Basic example:
script:
- pipe: rhendricksen/slack-notify:1.0.0
variables:
WEBHOOK_URL: $WEBHOOK_URL
MESSAGE: 'Hello, world!'
Content type
Image
Digest
Size
45.7 MB
Last updated
almost 6 years ago
docker pull rhendricksen/slack-notify-on-fail