Sign inSign up

rhendricksen/slack-notify-on-fail

By rhendricksen

•Updated almost 6 years ago

Bitbucket Pipelines pipe to send a notification to Slack on non-zero exit code

Image
0

50K+

rhendricksen/slack-notify-on-fail repository overview

⁠Bitbucket Pipelines Pipe: Slack Notify on Fail

Inspired by Slack Notify⁠ by Atlassian. Sends a custom notification to Slack⁠ on non-zero BITBUCKET_EXIT_CODE.

⁠YAML Definition

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.

⁠Variables

VariableUsage
WEBHOOK_URL (*)Incoming Webhook URL. It is recommended to use a secure repository variable.
MESSAGE (*)Notification message.
DEBUGTurn on extra debug information. Default: false.

(*) = required variable.

⁠Prerequisites

To send notifications to Slack, you need an Incoming Webhook URL. You can follow the instructions here⁠ to create one.

⁠Examples

Basic example:

script:
  - pipe: rhendricksen/slack-notify:1.0.0
    variables:
      WEBHOOK_URL: $WEBHOOK_URL
      MESSAGE: 'Hello, world!'

Tag summary

Content type

Image

Digest

Size

45.7 MB

Last updated

almost 6 years ago

docker pull rhendricksen/slack-notify-on-fail