Skip to content Menu

send-custom-netlify-build-slack-notification

Custom netlify build status in slack

Readme

netlify-status-topic

Set a Slack channel's topic with emojis based on your Netlify sites deploy statuses

code style: prettier

Setup

To set this up you'll need:

Follow this pattern or change them to your liking in the source code and set them up in your site's build environmental variables block

CHANNEL_ID=
SLACK_TOKEN=
NETLIFY_TOKEN=
NETLIFY_SITES=

Now that you have your info the best way to get this into your code-base is to follow Netlify's instructions for using their Functions feature.

Running

Once you have your lambda function set up and running with Netlify, the best way to start to use it is to create an outgoing webhook Deploy notification that hits the Netlify provided endpoint for your lambda function in production! Whenever your site deploy fails or succeeds have it hit the lambda function and you have a lovely little topic of your site's status in your Slack Channel of choice!

Customization

You can customize the ready and failed state emojis for the topic by adding two new environmental variables to your .env file or your build environmental variables block.

EMOJI_READY=:partyparrot:
EMOJI_FAILED=:fire: