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

  1. Create a webhook.stream URL.
  2. In the repository (or organisation) open Settings → Webhooks → Add webhook and paste it as the payload URL.
  3. 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.
  4. 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

FieldOperatorValue
headers.x-github-eventequalsrelease
body.actionequalspublished
Release template (a Discord embed)
{
  "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

FieldOperatorValue
headers.x-github-eventequalsworkflow_run
body.actionequalscompleted
body.workflow_run.conclusionequalsfailure
body.workflow_run.head_branchequalsmain
CI failure template
{
  "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

FieldOperatorValue
headers.x-github-eventequalsstar
body.actionequalscreated
Star template
{
  "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. content is 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_name tells them apart, in messages and in conditions.
Keeping it runningA free URL lives for up to 7 days, which is enough to build this and prove it works. To leave it in place, a Pro pass keeps the same URL alive for 30 days ($3) or 1 year ($19). It is a single payment, not a subscription, and nothing has to be reconfigured at the sender.

Variations

  • Pull requests opened by people, not bots: headers.x-github-event equals pull_request, body.action equals opened, body.sender.type does not equal Bot.
  • Slack instead of Discord: same conditions, with a text field in place of content.
  • 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.