Recipe
GitHub Webhooks to Discord: Releases and CI Failures, Worded Your Way
Discord can accept GitHub webhooks directly. The catch is that you get every event you subscribed to, in Discord's format, with no way to say "only failures" or "only main". A filter and a template in between fix both.
17 November 2026 · 3 min read
The built-in route, and why it runs out
If you add /github to the end of a Discord webhook URL and give that to GitHub, Discord renders GitHub's events natively. For a small repository that is enough, and you should use it.
It stops being enough when the channel fills up. GitHub lets you pick event types, but not conditions inside them. Subscribe to workflow runs and you hear about every run on every branch, successful or not. What most teams want is narrower: tell us when CI fails on main, and when a release ships.
Step 1: a Discord webhook
In the channel's settings choose Integrations → Webhooks → New Webhook and copy the URL. It starts with https://discord.com/api/webhooks/. Do not add /github this time: you will be sending Discord's own message format.
Step 2: point GitHub at a webhook URL
- Create a webhook.stream URL.
- In the repository (or organisation) open Settings → Webhooks → Add webhook and paste it as the payload URL.
- Set the content type to
application/json. GitHub's default is a form post with the JSON packed into one field, which makes the fields unreachable from a template. - Choose Let me select individual events and tick Releases, Workflow runs and Stars.
GitHub sends a ping event straight away. It appears in the inspector and confirms the connection. To get real samples, re-run a workflow and publish a draft release on a test repository.
Step 3: the automations
GitHub puts the event name in a header, X-GitHub-Event, and the detail in the body. Conditions can read both. For each rule below, choose Notify Discord and paste the Discord URL.
A release was published
| Field | Operator | Value |
|---|---|---|
headers.x-github-event | equals | release |
body.action | equals | published |
{
"username": "Releases",
"embeds": [
{
"title": "{{body.repository.full_name}} {{body.release.tag_name}}",
"url": "{{body.release.html_url}}",
"description": "{{body.release.body | default: \"No release notes.\" | truncate: 1500}}",
"color": 16738847
}
]
}An embed gives you a linked title and a coloured bar. color is a decimal number; 16738847 is orange. The truncate filter keeps long release notes from flooding the channel.
CI failed on main
| Field | Operator | Value |
|---|---|---|
headers.x-github-event | equals | workflow_run |
body.action | equals | completed |
body.workflow_run.conclusion | equals | failure |
body.workflow_run.head_branch | equals | main |
{
"content": "❌ **{{body.workflow_run.name}}** failed on `{{body.workflow_run.head_branch}}`\n{{body.workflow_run.head_commit.message | truncate: 120}} · {{body.workflow_run.actor.login}}\n<{{body.workflow_run.html_url}}>"
}Angle brackets around the link stop Discord from adding a large preview under the message.
Someone starred the repository
| Field | Operator | Value |
|---|---|---|
headers.x-github-event | equals | star |
body.action | equals | created |
{
"content": "⭐ **{{body.sender.login}}** starred {{body.repository.full_name}} ({{body.repository.stargazers_count}} so far)"
}Step 4: test and save
Select a captured request that should match, check the preview, and press Send test. Discord answers 204 when it accepts a message. If it answers 400, the start of its reply is shown in the delivery log and usually names the field it did not like.
Things worth knowing
- Discord's limits.
contentis limited to 2,000 characters and an embed description to 4,096. Truncate anything a person wrote. - GitHub does not retry. It gives a receiver ten seconds and then moves on. The URL answers in milliseconds, and every delivery stays in the inspector, so you can see whether an event arrived even when no rule matched it.
- Deliveries to Discord are not retried either. If Discord rate-limits a burst, those messages are logged as failed.
- One URL can serve many repositories. Register the same URL on each, or once at organisation level.
body.repository.full_nametells them apart, in messages and in conditions.
Variations
- Pull requests opened by people, not bots:
headers.x-github-eventequalspull_request,body.actionequalsopened,body.sender.typedoes not equalBot. - Slack instead of Discord: same conditions, with a
textfield in place ofcontent. - Start a workflow instead of posting a message: see triggering GitHub Actions from a webhook.
For GitHub's headers and signature scheme, see the GitHub webhook guide.
See what GitHub sends first
Create a URL, add it to a test repository and look at a real workflow_run payload. The fields you want to filter on are easier to find in a real request than in the documentation.
Keep reading
Webhook filtering
Filter webhooks by event type, amount, branch, header or path before they reach a channel or an API. How conditions work, ten patterns worth copying, and how to express OR.
ReadTrigger GitHub Actions from a webhook
Start a GitHub Actions workflow when a CMS, form tool or any other service sends a webhook, by reshaping it into a repository_dispatch call. No server and no extra CI plugin.
Read