Sending GitHub updates to Discord via webhooks

·2 min. read·

Have you ever wanted to receive GitHub repository updates on your Discord server? Let's walk through a few simple steps to connect GitHub to Discord using webhooks and configure the event notifications!

  1. Choose the channel where you want to send updates from GitHub.
  2. Hover your mouse cursor over the channel, then click on the gear icon for "Edit Channel".
  3. Go to the "Integrations" tab, then select "Webhooks".
  4. Click the "Create Webhook" button, which will generate a new webhook with a random name.
  5. Let's rename the webhook to "Github" and save the changes.
  6. Click on "Copy Webhook URL" - we'll need this URL for the next step.

Example URL: https://discord.com/api/webhooks/1142536189203718235/Ep-gTnqmq3V0ATWij9n1LohHyLLxSQjqsT2Av7tM3CgvTYCTZ5PHNAFY1w7YD0NXXr8P

Webhook creation menu in Discord
Webhook creation menu in Discord
  1. Open the GitHub repository and navigate to "Settings".
  2. Go to the "Webhooks" tab in the left menu, then click on "Add webhook."
  3. Paste the webhook's URL into Payload URL, which you created in the previous step, and add the suffix /github to the end of it so that the URL changes as follows: https://discord.com/api/webhooks/xxx/yyy/github
  4. Change the Content type to application/json.
  5. You can choose the event types that should be sent with this webhook; for simplicity, select "Send me everything" for now.
  6. Complete the webhook addition by clicking the "Add webhook" button.
Webhook menu in Github
Webhook menu in Github

Let's try performing a few simple actions to test the webhook event sending: we'll make a commit to the repository and add a star.

Example Discord webhook messages
Example Discord webhook messages

As we can see, messages about GitHub repository events are successfully coming to the Discord channel 🤩.

You may also like

Killing Floor monsters in Counter-Strike
Sorry, I don't IPs of these servers. 😳 Gorefast (XMAS) in Counter-Strike... Read more
·1 min. read
Yarn vs NPM install speed comparison
Comparing the installation speed of Yarn and NPM packages across several... Read more
·2 min. read
How to reinitialize multiple TinyMCE editors
At some point, there was a need to reload multiple TinyMCE editors on one page,... Read more
·1 min. read

© geekrainian.com