skip to content
Home Image

Setting up GitHub Webhook Integration with Discord

Step 1: Create the Webhook in Discord

You first need a unique, secret URL from Discord that GitHub can send data to.

  1. Navigate to your Discord server and the specific text channel (e.g., #dev-alerts).
  2. Go to Channel Settings → Integrations → Webhooks.
  3. Click New Webhook.
  4. Click Copy Webhook URL.

⚠️ SECURITY WARNING: Treat this URL like a password. Anyone who has it can post messages to your channel. Do not commit it directly to a public repository.

Step 2: Configure the GitHub Repository

Now, connect that Discord URL to your repo’s settings.

  1. Open your GitHub repository and go to Settings → Webhooks.

  2. Click the Add webhook button.

  3. Configure the Webhook Fields:

    • Payload URL: Paste the Discord URL here. You must append /github to the very end.
      • Example: https://discord.com/api/webhooks/.../token/github
    • Content type: Set this to application/json (usually the default).
    • Secret: Leave this field blank.
    • Which events would you like to trigger this webhook?
      • For a simple setup, select “Just the push event.”
      • Send me everything “Pushes notification of Everything”
      • For detailed alerts, select “Let me select individual events” and check Pushes, Pull requests, and Issues.
  4. Ensure the Active box is checked.

  5. Click Add webhook.

Step 3: Test the Integration

  1. After adding the webhook, GitHub automatically sends a test payload. Check your Discord channel for a successful confirmation message.
  2. Perform a test action on your repo (e.g., starred your repository or push a commit).
  3. You should see a notification appear in your Discord channel immediately..