Test GitHub webhooks locally
GitHub webhooks are easiest to debug when you can see the JSON payload and delivery headers outside the repository settings page. Use Mercur’s online tester first, then forward to localhost when your app is ready.
1. Get a public HTTPS URL
Open the webhook tester
Copy the temporary endpoint. Guest mode needs no account and expires after idle TTL.
2. Add a repository webhook
In your GitHub repo: Settings → Webhooks → Add webhook.
- Payload URL — paste your Mercur URL
- Content type —
application/json(recommended) - Secret — optional for first inspection; required later for signature checks in your app
- Events — start with Just the push event, or choose Send me everything while debugging
Click Add webhook. GitHub sends a ping event immediately.
3. Compare deliveries
Open Recent Deliveries in GitHub and the request history in Mercur side by side:
- Confirm the
X-GitHub-Eventheader (ping,push, …) - Inspect the JSON body GitHub posted
- Note
X-Hub-Signature-256when a secret is configured
If GitHub shows a failed delivery but Mercur has no log entry, the request never reached the endpoint (URL typo, DNS, or blocked outbound). If Mercur has the entry, the provider side succeeded and you can focus on your handler.
4. Trigger a real event
Push a commit, open a pull request, or redeliver from Recent Deliveries. Each attempt appears in Mercur with the same headers GitHub sent.
5. Forward to localhost
When you need your local server to respond:
- Register for a free Mercur account
- Start a Local Tunnel to your local port
- Update the GitHub Payload URL to the tunnel endpoint
- Use Record Session in the console to capture live tunnel traffic
Keep the webhook secret in your app’s environment for X-Hub-Signature-256 verification.
Related
Inspect a GitHub delivery now