Using Gitter’s Native GitHub Webhook for Real‑Time Notifications
Learn how to connect a Gitter room to a GitHub repository so commits, pull‑requests and issue events appear as formatted messages, with setup steps, benefits, limits and verification tips.
17 Jul 2025, 04:06 UTC

Problem: Staying in sync without leaving chat
When a team discusses code in Gitter, every new commit, pull‑request or issue forces a context switch to GitHub to see what changed. This interrupts flow and can cause delays in feedback. A lightweight way to push those events directly into the chat room eliminates the switch and keeps everyone informed.
Thesis: Gitter’s built‑in GitHub webhook gives you real‑time, formatted notifications with zero custom code
By configuring a single webhook URL from the repository’s Settings → Webhooks page, GitHub will POST a JSON payload for the events you select. Gitter consumes that payload and renders a markdown message that includes links, avatars and a short diff summary. No extra bots, scripts or third‑party services are required.
How to set it up
- Get the webhook URL from Gitter
- Open the target Gitter room.
- Click the room’s
Settingsgear →Integrations→Webhooks. - Copy the displayed URL; it looks like
https://webhook.gitter.im/e/xxxxxxxxxxxxxxxxxxxx.
- Add the webhook in GitHub
- Navigate to the repository →
Settings→Webhooks→Add webhook. - Paste the Gitter URL into the
Payload URLfield. - Set
Content typetoapplication/json. - Choose which events to send: at minimum
PushandPull request; addIssuesif you want issue updates. - Leave the secret blank (Gitter does not validate a secret).
- Click
Add webhook.
- Navigate to the repository →
- Verify the connection
- In the GitHub webhook list, click the new entry to see
Recent Deliveries. - Push a test commit or open a pull‑request.
- Check that a delivery shows HTTP
200response. - Return to the Gitter room; you should see a formatted message with the commit SHA, author avatar, and a link to the diff.
- In the GitHub webhook list, click the new entry to see
Worked example: Notifying a feature branch push
Assume a repository myorg/frontend and a Gitter room named #frontend‑chat.
# 1. Obtain webhook URL (copy from Gitter integrations)
WEBHOOK_URL="https://webhook.gitter.im/e/1a2b3c4d5e6f7g8h9i0j"
# 2. Add webhook via GitHub API (requires repo admin token)
curl -X POST \
-H "Authorization: token $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/myorg/frontend/hooks \
-d '{
"name": "web",
"active": true,
"events": ["push", "pull_request"],
"config": {
"url": "'"$WEBHOOK_URL"'",
"content_type": "json"
}
}'
# 3. Trigger a test push
git checkout -b feature/notifications
# make a change, commit
git commit -am "Add notification test"
git push origin feature/notifications
After the push, GitHub sends a POST to the URL above. Gitter renders something like:
**[avatar] username** pushed 1 commit to feature/notifications
- a1b2c3d Add notification test
[Compare changes](https://github.com/myorg/frontend/compare/feature/notifications)
Benefits
- Zero‑maintenance: no external bot to host or update.
- Immediate visibility: every selected event appears as soon as GitHub finishes processing.
- Reduced context switching: developers stay in Gitter while still seeing code activity.
Trade‑offs and limitations
- One room per repository: a single webhook URL can point to only one Gitter room. If you need separate rooms for different teams, you must duplicate the repository or use a third‑party router.
- Potential noise: enabling the
pushevent for every branch can flood the chat. Mitigation strategies include:- Limiting pushes to specific branches (e.g., only
mainand release branches) via theBranch filteroption in the webhook UI. - Using the
pushevent with a commit limit (GitHub sends at most 20 commits per payload; still, frequent pushes can be noisy).
- Limiting pushes to specific branches (e.g., only
- Delivery reliability: GitHub retries failed deliveries with exponential backoff, but transient network issues can cause delays or missed messages. Checking the
Recent Deliverieslog helps spot problems early.
Actionable closing
If your team already lives in Gitter, adding the native GitHub webhook is a low‑effort way to bring code activity into the chat. Start with a test repository, enable only the events you truly need, monitor the delivery logs for the first 24 hours, and then roll it out to active projects. Should the noise become an issue, adjust the branch filter or switch to a manual pull‑request‑only subscription until you find the right balance.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.