In this tutorial I'll show you how to create a Github webhook that will post updates from your Github account to a channel in Discord. The steps are simple so follow along!
First you need to create a webhook in a text channel. We're assuming you have both Manage Channel
and Manage Webhooks
permissions!
- Go in a channel properties (Alternatively, Server Settings, Webhooks works too)
- Click Webhooks
- Click Create Webhook
- Type in a name (this is for local reference, it's overriden by the incoming hook data)
- Copy the Webhook URL (you can use the Copy button)
- Click Save
Note: Do NOT give the Webhook 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!
In order to do this you need to be the owner of the github repository. Even Collaborators cannot access settings.
- Click on Settings
- Click on Webhooks
- Click on Add Webhook
- The Payload URL is the webhook URL with
/github
added to the end. - Leave Secret blank, change the Content-Type to
application/json
- Select what type of events you want
- Click Add Webhook
Note: The "test" payload will not show anything in your channel. That is normal. You will need to actually take an action in order to show any activity. However, make sure the test payload has a green checkmark, and the response is 204.
Make sure to add /github at the end of the webhook URL.
No, Github controls that part, so they're choosing the name and Avatar.
Under Which events would you like to trigger this webhook?, select Let me select individual events.
Check the events you'd like to receive. There are a lot of them.
That's it. That's all you had to do. Now go code!
nvm how do I insert the webhook to discord