Skip to content

Instantly share code, notes, and snippets.

@jagrosh
Last active February 26, 2025 18:13
Show Gist options
  • Save jagrosh/5b1761213e33fc5b54ec7f6379034a22 to your computer and use it in GitHub Desktop.
Save jagrosh/5b1761213e33fc5b54ec7f6379034a22 to your computer and use it in GitHub Desktop.
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings

  2. Select Add Webhook Add

  3. Paste in the webhook url and append /github to the end. Select "Send me everything", set the type to application/json, and then Add Webhook WebhookSettings

  4. Test it by updating something or starring the repository! If it works, you're all set! Star

@awalpremi
Copy link

Ty for this. Anyone know how to filter pull requests only? It would be ideal to have pull request opened and closed only to avoid clutter.

@The-LukeZ
Copy link

Ty for this. Anyone know how to filter pull requests only? It would be ideal to have pull request opened and closed only to avoid clutter.

image

Go here and only select the Pull requests.

@cdnghost
Copy link

How do I have this webhook pull posts from another discord server and post into mine? is that even possible?

@The-LukeZ
Copy link

The-LukeZ commented Jan 21, 2025 via email

@awalpremi
Copy link

Ty for this. Anyone know how to filter pull requests only? It would be ideal to have pull request opened and closed only to avoid clutter.

image

Go here and only select the Pull requests.

That was it, don't know how I missed it. Thanks

@mydkong
Copy link

mydkong commented Feb 1, 2025

Got it working:

1. delete hook

2. create new hook

3. add /github at the end,

4. select content type to `application/json`

my man <3 +1

Yes it's working <3

@hijuliancode
Copy link

Got it working:

1. delete hook

2. create new hook

3. add /github at the end,

4. select content type to `application/json`

my man <3 +1

Yes it's working <3

It works for me, thanks

@Ifycode
Copy link

Ifycode commented Feb 8, 2025

Very helpful, thank you. In my case I only needed it for issue ticket integration, so I selected "Let me select individual events" 👍🏼

@Jenspi
Copy link

Jenspi commented Feb 20, 2025

Works perfectly!

This is perfect for not needing to update my partners each time I make changes. Thank you for this! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment