Skip to content

Instantly share code, notes, and snippets.

@jagrosh
Last active July 16, 2026 01:46
Show Gist options
  • Select an option

  • Save jagrosh/5b1761213e33fc5b54ec7f6379034a22 to your computer and use it in GitHub Desktop.

Select an option

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

@haddercone

Copy link
Copy Markdown

any idea why is necesary to add /github at the end?? It work, but...

Because it helps GitHub to map to a specific endpoint in case of discord.
You can have multiple endpoint on a single domain.

You can achieve this by creating your own endpoints.
E.g. you can create a simple node.js server which has two endpoints /a and /b that do different tasks.

  • Host your node js server on service like render. It will provide you with a domain.
  • Create two different webhooks in GitHub.
  • For each webhook, keep the domain name same but add different endpoints for different GitHub event.

Now you have two webhooks which are mapped to two different GitHub events, but with a single domain name.

@luisangeldevops

luisangeldevops commented Jul 17, 2024 via email

Copy link
Copy Markdown

@KobeW50

KobeW50 commented Aug 8, 2024

Copy link
Copy Markdown

is it possible to ping/mention/notify everyone or certain people using the webhook?

Hi. Have you found a way to achieve this?

@The-LukeZ

The-LukeZ commented Aug 8, 2024 via email

Copy link
Copy Markdown

@KobeW50

KobeW50 commented Aug 8, 2024

Copy link
Copy Markdown

You can, but not natively. You can either use a bot that can automatically respond with a ping or (a bit trickier) use a bot and a private channel for the Girhub-webhook, so that GitHub sends the message to your private Discord channel and the bot "copies" this message and adds mentions.

Thank you. Do you know of any public bots that can do either of these? (I only tried YAGPDB, but even custom commands doesn't work since it doesn't listen for webhooks)

(Also, a few minutes ago someone shared this with me. It just seems like a bit of a pain to set up)

@mrgoonie

mrgoonie commented Aug 8, 2024

Copy link
Copy Markdown

@The-LukeZ

The-LukeZ commented Aug 8, 2024

Copy link
Copy Markdown

You can, but not natively. You can either use a bot that can automatically respond with a ping or (a bit trickier) use a bot and a private channel for the Girhub-webhook, so that GitHub sends the message to your private Discord channel and the bot "copies" this message and adds mentions.

Thank you. Do you know of any public bots that can do either of these? (I only tried YAGPDB, but even custom commands doesn't work since it doesn't listen for webhooks)

(Also, a few minutes ago someone shared this with me. It just seems like a bit of a pain to set up)

I would suggest Sapphire with the new Sticky Message feature for "reply with ping".
It could also be possible to use the Automod feature but I don't know if bot-messages (what a webhook message is) are recognized.
I could make you a custom bot that does this easily if you want (@thelukez)

@KobeW50

KobeW50 commented Aug 8, 2024

Copy link
Copy Markdown

Thank you for the advice and the offer @The-LukeZ 🙏

I opted to try @mrgoonie 's suggestion, and it is working flawlessly. Thank you

@impanda123

Copy link
Copy Markdown

Hello I have a problem I cant see the description when i commit to main

@The-LukeZ

The-LukeZ commented Sep 6, 2024

Copy link
Copy Markdown

Hello I have a problem I cant see the description when i commit to main

Descriptions won't show up. I also noticed this.

@unenergizer

Copy link
Copy Markdown

I ended up using this Github Actions: https://github.com/marketplace/actions/actions-status-discord

Will I be able to show the entire commit message using this?

What I get on discord:
image
It truncates a large portion of my commit messages. This is how I show progress on my project(s).

@mrgoonie

Copy link
Copy Markdown

I ended up using this Github Actions: https://github.com/marketplace/actions/actions-status-discord

Will I be able to show the entire commit message using this?

What I get on discord: image It truncates a large portion of my commit messages. This is how I show progress on my project(s).

It totally depends on you, grab all commit messages in your action steps and pass them to this action in "description" param

I don't need that, just want the PR title, so this is what I got:
CleanShot 2024-11-23 at 16 31 15@2x

@AndyLevesque

Copy link
Copy Markdown

FYI - If wanting to send GitHub messages to a Discord forum thread, add "/github?thread_id=[thread number here from thread URL]"

@awalpremi

Copy link
Copy Markdown

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
Copy Markdown

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.

@iamlemoose

Copy link
Copy Markdown

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

@The-LukeZ

The-LukeZ commented Jan 21, 2025 via email

Copy link
Copy Markdown

@awalpremi

Copy link
Copy Markdown

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

mydkong commented Feb 1, 2025

Copy link
Copy Markdown

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
Copy Markdown

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

Ifycode commented Feb 8, 2025

Copy link
Copy Markdown

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

@Jenspi

Jenspi commented Feb 20, 2025

Copy link
Copy Markdown

Works perfectly!

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

@SchBenedikt

Copy link
Copy Markdown

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

Yes, now it works 👍

@Robicus

Robicus commented Mar 6, 2025

Copy link
Copy Markdown

The issue I have is that I'm not actually seeing messages in the payload that appears in Github:
image

This is for both the initial test ping event, in addition to be triggering an event by closing out a branch.

@Robicus

Robicus commented Mar 7, 2025

Copy link
Copy Markdown

The issue I have is that I'm not actually seeing messages in the payload that appears in Github: image

This is for both the initial test ping event, in addition to be triggering an event by closing out a branch.

Whooops. Had to make sure my user settings allowed showing previews.
image

@Akira-Kuru

Copy link
Copy Markdown

Tested it and it works overall but review_requested is missing and is the one I personally need to approve PRs

@geekelo

geekelo commented Apr 6, 2025

Copy link
Copy Markdown

IT WORKS FOR ME

  1. delete hook

  2. create new hook

  3. add /github at the end,

  4. select content type to application/json

@DanXoc

DanXoc commented Jun 9, 2025

Copy link
Copy Markdown

create new hook

@EwinSkyTech

EwinSkyTech commented Jul 10, 2025

Copy link
Copy Markdown

Hello there. I am an absolute noob. I am trying to use Webhooks in discord to get instagram feeds into my channel. I followed your instructions and I can not figure out where in the mentioned steps I can input the instagram profile of the user I need the feed from.

  1. Created Webhooks using spidey bot. 2. Input name and channel where the feed should land. 3 copy Webhook. 4. paste in Github creating a new Webhook. 5. add Webhooks.

In which of the above steps do I input the actual Instagram link? I am utterly confused

@qtqgyt

qtqgyt commented Jul 14, 2025

Copy link
Copy Markdown

Hello there. I am an absolute noob. I am trying to use Webhooks in discord to get instagram feeds into my channel. I followed your instructions and I can not figure out where in the mentioned steps I can input the instagram profile of the user I need the feed from.

  1. Created Webhooks using spidey bot. 2. Input name and channel where the feed should land. 3 copy Webhook. 4. paste in Github creating a new Webhook. 5. add Webhooks.

In which of the above steps do I input the actual Instagram link? I am utterly confused

What does any of this have to do with Instagram?

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