Skip to main content

Adding a Slack webhook

Abstract

You can set up a webhook on to send automated messages on Slack about your Bitrise builds.

You can register the bitrise-webhooks URL as an outgoing webhook.

Once the URL is registered, check the usage section for all the accepted and required parameters you can define in the message, and for a couple of examples.

Getting the webhook URL for Slack

Admin access only

Only users with the role of admin on the app's team can access all functions of the App Settings page of an app.

  1. Open your app on Bitrise.

  2. Click on App Settings.

  3. Go to your app’s page on Bitrise.

  4. On the left, select Integrations.

  5. Click Set up webhooks manually.

  6. Choose Slack from the dropdown menu.

    apps-webhooks-select.png
  7. Copy the webhook URL.

  8. Register the URL to your Slack app.

Usage: the message format

Your message has to be in the format: key:value|key:value|..., where the supported keys are:

At least one of these two parameters are required:

  • b or branch - example: branch: master

  • w or workflow - example: workflow: primary

Other, optional parameters:

  • t or tag - example: branch: master|tag: v1.0

  • c or commit - example: workflow: primary|commit: eee55509f16e7715bdb43308bb55e8736da4e21e

  • m or message - example: branch: master|message: ship it!!

Parameter requirements

At least either branch or workflow has to be specified, and you can specify both if you want to. You’re free to specify any number of optional parameters.

You can also send environment variables that will be available in your workflow with the format: env[KEY1]:value1|ENV[KEY2]:value2

An example with all parameters included:

workflow: primary|b: master|tag: v1.0|commit:eee55509f16e7715bdb43308bb55e8736da4e21e|m: start my build!|ENV[DEVICE_NAME]:iPhone 6S|ENV[DEVICE_UDID]:82667b4079914d4aabed9c216620da5dedab630a