Receiving Build Notifications via Discord Webhooks
Created Oct 27, 2018 – Last Updated Apr 20, 2021
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”:
Paste the webhook URL from your clipboard to the input for the outgoing webhook URL.
#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.
You can use the same webhook URL multiple times to get notifications from multiple builds into the same channel.