Skip to content

Receiving Build Notifications via Discord Webhooks


Created Oct 27, 2018 – Last Updated Apr 20, 2021

Discord
Digital Garden

Many CI/CD services support both incoming and outgoing webhooks for the communication with external services. Also Discord allows the usage of webhooks to display messages — so receiving build notifications in your Discord server is totally doable! For this example I’m using Gatsby Cloud but the same steps (albeit with a different UI) also apply to services like Netlify or CircleCI.

#Step 1: Create the Discord webhook

Choose a channel on your server in which the messages should come in. Right-click on the channel => Edit Channel => Integrations => Webhooks. Click on New Webhook. Press the Copy Webhook URL button to have the webhook URL in your clipboard.

#Step 2: Go to your CI/CD service

Visit your dashboard where you can set Notifications and add a notification of type “Webhooks”:

Section of the Dashboard on gatsbyjs.com. At the 'Outgoing Notifications' section there's a button called 'Add notification'. After pressing it you'll see a context menu with the items Webhooks, Slack, and Pull-Request comment. Click on Webhooks.

Paste the webhook URL from your clipboard to the input for the outgoing webhook URL.

The sidebar menu lets you choose an event to listen to (you can choose between: Build Succeeded, Build Failed, Deploy Succeeded, and Deploy Failed) and add the copied webhook URL to the input of "outgoing webhook URL". Then press "Save".

#Step 3: Add /slack to the webhook URL

Discord explains in their developer documentation that you need to add /slack to the end of the webhook URL to receive webhook messages in the proper format.

The final input field with the added slack postfix

You can use the same webhook URL multiple times to get notifications from multiple builds into the same channel.


Want to learn more? Browse my Digital Garden