Mock a GitHub push webhook
A GET mock shaped like a GitHub push event, with one commit on refs/heads/main.
Returns a ready-made event — feed it straight into your own handler.
Response payload
{
"ref": "refs/heads/main",
"before": "a10867b14bb761a232cd80139fbd4c0d33264240",
"after": "b7e1a2c3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9",
"repository": {
"full_name": "octocat/quickmock-demo"
},
"pusher": {
"name": "octocat"
},
"commits": [
{
"id": "b7e1a2c3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9",
"message": "fix: handle empty payload",
"timestamp": "2024-05-01T12:00:00Z"
}
]
}
Fields worth knowing
| Field | What it means |
|---|---|
| ref | The branch that was pushed to, e.g. refs/heads/main. |
| after | The commit SHA after the push — later GitHub API calls reference it. |
| repository.full_name | The repository name as owner/repo; edit it to match your test repo. |
| pusher.name | The GitHub username who pushed. |
| commits | The commits included in this push — trimmed to one here. |
Create the mock
curl -X POST https://quickmock.dev/api/mocks \
-H 'Content-Type: application/json' \
-d '{
"method": "GET",
"response_status": 200,
"content_type": "application/json",
"response_body": "{\"ref\":\"refs/heads/main\",\"before\":\"a10867b14bb761a232cd80139fbd4c0d33264240\",\"after\":\"b7e1a2c3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9\",\"repository\":{\"full_name\":\"octocat/quickmock-demo\"},\"pusher\":{\"name\":\"octocat\"},\"commits\":[{\"id\":\"b7e1a2c3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9\",\"message\":\"fix: handle empty payload\",\"timestamp\":\"2024-05-01T12:00:00Z\"}]}"
}'
Call it
curl https://quickmock.dev/m/<slug>
What you get
GET /m/<slug> -> 200 a GitHub-style push event
one commit on refs/heads/main
How this differs from the real thing
This is a single static commit rather than the full field set a real push event carries — no X-Hub-Signature-256 header, no sender or head_commit, no compare URL.
Ready to use it?
Pairs well with this guide: Test a webhook receiver