DevOps
GitHub Webhook (Push Event) JSON Example
A real-world JSON example of a GitHub webhook push event payload — ref, commits, pusher, and repository info. Copy-ready for building CI triggers, deploy bots, and GitHub App integrations.
Field Reference
refrequiredstringThe full git ref that was pushed, e.g. refs/heads/main — check this to filter for a specific branchbefore / afterrequiredstringThe commit SHAs before and after the push — 'before' is all zeros for a new branch's first pushcommitsrequiredarrayEvery commit included in the push, oldest first — can be empty for a force-push that removes commitspusherrequiredobjectThe GitHub user who performed the push — not necessarily the commit authorrepository.default_branchrequiredstringUseful for detecting whether this push was to the repo's default branch, since ref alone doesn't tell you thatVariants
New Branch (First Push)before is all zeros, signaling this ref did not exist before this push.
Common Use Cases
- →Triggering a CI/CD pipeline or deploy bot in response to pushes to a specific branch
- →Building a custom Slack/Discord notification bot for team commit activity
- →Auditing which files changed in a push without cloning the repository
githubwebhookpush eventci/cdgit
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.