Test GitHub webhooks locally
Point a GitHub repository or organisation webhook at Tofu, then forward push, pull request, and workflow events to your local app. Replay payloads while fixing a handler without redeploying.
$ tofu hooks create github --name "GitHub"$ tofu hooks url github$ tofu targets set local "http://127.0.0.1:3000/api/webhooks/github" --hook github$ tofu watch githubSetup checklist
- Set the GitHub content type to application/json.
- Use replay after changing signature validation, branch filters, or event parsing.
Content type and signing
Set the content type to application/json on the GitHub webhook. The signing secret protects the raw body, sent in the X-Hub-Signature-256 header. Your handler must read the raw body before parsing, or the HMAC will not match.
Iterating on branch and event filters
Replay is especially useful for narrow filters: you can iterate on branch filters, action types, or label conditions against a real push or pull request payload without waiting for someone to open another PR.
Organisation and app webhooks
Use a separate hook per source. Repository webhooks, org webhooks, and GitHub App webhooks have different signing keys and event sets, so giving each its own hook keeps secrets and event streams cleanly separated.