Push
This event occurs when there is a push to a repository branch. This includes when a commit is pushed, when a commit tag is pushed,
when a branch is deleted, when a tag is deleted, or when a repository is created from a template. To subscribe to only branch
and tag deletions, use the delete webhook event.
Actions
| Action | Sent when |
|---|---|
push | This event occurs when there is a push to a repository branch. This includes when a commit is pushed, when a commit tag is pushed, |
Payload
Fields of the delivery for the first action above. Every action shares the event's core fields.
| Field | Type | Required | Description |
|---|---|---|---|
after | string | Yes | The SHA of the most recent commit on ref after the push. |
base_ref | string | Yes | |
before | string | Yes | The SHA of the most recent commit on ref before the push. |
commits | array<object> | Yes | An array of commit objects describing the pushed commits. (Pushed commits are all commits that are included in the compare between the before commit and the after commit.) The array includes a maximum of 2048 commits. If necessary, you can use the Commits API to fetch additional commits. |
compare | string | Yes | URL that shows the changes in this ref update, from the before commit to the after commit. For a newly created ref that is directly based on the default branch, this is the comparison between the head of the default branch and the after commit. Otherwise, this shows all commits until the after commit. |
created | boolean | Yes | Whether this push created the ref. |
deleted | boolean | Yes | Whether this push deleted the ref. |
enterprise | object | No | An enterprise on GitHub. Webhook payloads contain the enterprise property when the webhook is configured |
forced | boolean | Yes | Whether this push was a force push of the ref. |
head_commit | object | Yes | |
installation | object | No | The GitHub App installation. Webhook payloads contain the installation property when the event is configured |
organization | object | No | A GitHub organization. Webhook payloads contain the organization property when the webhook is configured for an |
pusher | object | Yes | Metaproperties for Git author/committer information. |
ref | string | Yes | The full git ref that was pushed. Example: refs/heads/main or refs/tags/v3.14.1. |
Subscribing
This event occurs when there is a push to a repository branch. This includes when a commit is pushed, when a commit tag is pushed,
when a branch is deleted, when a tag is deleted, or when a repository is created from a template. To subscribe to only branch
and tag deletions, use the delete webhook event.