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

ActionSent when
pushThis 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.

FieldTypeRequiredDescription
afterstringYesThe SHA of the most recent commit on ref after the push.
base_refstringYes
beforestringYesThe SHA of the most recent commit on ref before the push.
commitsarray<object>YesAn 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.
comparestringYesURL 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.
createdbooleanYesWhether this push created the ref.
deletedbooleanYesWhether this push deleted the ref.
enterpriseobjectNoAn enterprise on GitHub. Webhook payloads contain the enterprise property when the webhook is configured
forcedbooleanYesWhether this push was a force push of the ref.
head_commitobjectYes
installationobjectNoThe GitHub App installation. Webhook payloads contain the installation property when the event is configured
organizationobjectNoA GitHub organization. Webhook payloads contain the organization property when the webhook is configured for an
pusherobjectYesMetaproperties for Git author/committer information.
refstringYesThe 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.