This page was generated based on Github’s Documentation. See our welcome page for context and details.
Github Event status
#
Github Action Trigger #
Webhook event payload | Activity types | GITHUB_SHA | GITHUB_REF |
---|---|---|---|
status | Not applicable | Last commit on default branch | Not applicable |
Note: This event will only trigger a workflow run if the workflow file is on the default branch.
Runs your workflow when the status of a Git commit changes. For example, commits can be marked as error
, failure
, pending
, or success
. If you want to provide more details about the status change, you may want to use the check_run
event. For information about the commit status APIs, see “Objects” in the GraphQL API documentation or “REST API endpoints for commits.”
For example, you can run a workflow when the status
event occurs.
on:
status
If you want to run a job in your workflow based on the new commit state, you can use the github.event.state
context. For example, the following workflow triggers when a commit status changes, but the if_error_or_failure
job only runs if the new commit state is error
or failure
.
on:
status
jobs:
if_error_or_failure:
runs-on: ubuntu-latest
if: >-
github.event.state == 'error' ||
github.event.state == 'failure'
steps:
- env:
DESCRIPTION: ${{ github.event.description }}
run: |
echo The status is error or failed: $DESCRIPTION
Event Payload #
This event occurs when the status of a Git commit changes. For example, commits can be marked as error
, failure
, pending
, or success
. For more information, see "About status checks." For information about the APIs to manage commit statuses, see the GraphQL documentation or "Commit statuses" in the REST API documentation.
To subscribe to this event, a GitHub App must have at least read-level access for the "Commit statuses" repository permission.
field | type | required | description |
---|---|---|---|
github.event.avatar_url | string or null | optional | |
github.event.branches | array of objects | required | An array of branch objects containing the status’ SHA. Each branch contains the given SHA, but the SHA may or may not be the head of the branch. The array includes a maximum of 10 branches. |
github.event.branches.commit | object | required | |
github.event.branches.commit.sha | string or null | required | |
github.event.branches.commit.url | string or null | required | |
github.event.branches.name | string | required | |
github.event.branches.protected | boolean | required | |
github.event.commit | object | required | |
github.event.commit.author | object or null | required | |
github.event.commit.author.avatar_url | string | optional | |
github.event.commit.author.deleted | boolean | optional | |
github.event.commit.author.email | string or null | optional | |
github.event.commit.author.events_url | string | optional | |
github.event.commit.author.followers_url | string | optional | |
github.event.commit.author.following_url | string | optional | |
github.event.commit.author.gists_url | string | optional | |
github.event.commit.author.gravatar_id | string | optional | |
github.event.commit.author.html_url | string | optional | |
github.event.commit.author.id | integer | optional | |
github.event.commit.author.login | string | optional | |
github.event.commit.author.name | string | optional | |
github.event.commit.author.node_id | string | optional | |
github.event.commit.author.organizations_url | string | optional | |
github.event.commit.author.received_events_url | string | optional | |
github.event.commit.author.repos_url | string | optional | |
github.event.commit.author.site_admin | boolean | optional | |
github.event.commit.author.starred_url | string | optional | |
github.event.commit.author.subscriptions_url | string | optional | |
github.event.commit.author.type | Bot , User , Organization | optional | |
github.event.commit.author.url | string | optional | |
github.event.commit.comments_url | string | required | |
github.event.commit.commit | object | required | |
github.event.commit.commit.author | object | required | |
github.event.commit.commit.author.date | string | required | |
github.event.commit.commit.author.email | string or null | required | |
github.event.commit.commit.author.name | string | required | The git author’s name. |
github.event.commit.commit.author.username | string | optional | |
github.event.commit.commit.comment_count | integer | required | |
github.event.commit.commit.committer | object | required | |
github.event.commit.commit.committer.date | string | required | |
github.event.commit.commit.committer.email | string or null | required | |
github.event.commit.commit.committer.name | string | required | The git author’s name. |
github.event.commit.commit.committer.username | string | optional | |
github.event.commit.commit.message | string | required | |
github.event.commit.commit.tree | object | required | |
github.event.commit.commit.tree.sha | string | required | |
github.event.commit.commit.tree.url | string | required | |
github.event.commit.commit.url | string | required | |
github.event.commit.commit.verification | object | required | |
github.event.commit.commit.verification.payload | string or null | required | |
github.event.commit.commit.verification.reason | expired_key , not_signing_key , gpgverify_error , gpgverify_unavailable , unsigned , unknown_signature_type , no_user , unverified_email , bad_email , unknown_key , malformed_signature , invalid , valid , bad_cert , ocsp_pending | required | |
github.event.commit.commit.verification.signature | string or null | required | |
github.event.commit.commit.verification.verified | boolean | required | |
github.event.commit.committer | object or null | required | |
github.event.commit.committer.avatar_url | string | optional | |
github.event.commit.committer.deleted | boolean | optional | |
github.event.commit.committer.email | string or null | optional | |
github.event.commit.committer.events_url | string | optional | |
github.event.commit.committer.followers_url | string | optional | |
github.event.commit.committer.following_url | string | optional | |
github.event.commit.committer.gists_url | string | optional | |
github.event.commit.committer.gravatar_id | string | optional | |
github.event.commit.committer.html_url | string | optional | |
github.event.commit.committer.id | integer | optional | |
github.event.commit.committer.login | string | optional | |
github.event.commit.committer.name | string | optional | |
github.event.commit.committer.node_id | string | optional | |
github.event.commit.committer.organizations_url | string | optional | |
github.event.commit.committer.received_events_url | string | optional | |
github.event.commit.committer.repos_url | string | optional | |
github.event.commit.committer.site_admin | boolean | optional | |
github.event.commit.committer.starred_url | string | optional | |
github.event.commit.committer.subscriptions_url | string | optional | |
github.event.commit.committer.type | Bot , User , Organization | optional | |
github.event.commit.committer.url | string | optional | |
github.event.commit.html_url | string | required | |
github.event.commit.node_id | string | required | |
github.event.commit.parents | array of objects | required | |
github.event.commit.parents.html_url | string | required | |
github.event.commit.parents.sha | string | required | |
github.event.commit.parents.url | string | required | |
github.event.commit.sha | string | required | |
github.event.commit.url | string | required | |
github.event.context | string | required | |
github.event.created_at | string | required | |
github.event.description | string or null | required | The optional human-readable description added to the status. |
github.event.enterprise | object | optional | An enterprise on GitHub. Webhook payloads contain the |
github.event.id | integer | required | The unique identifier of the status. |
github.event.installation | object | optional | The GitHub App installation. Webhook payloads contain the |
github.event.name | string | required | |
github.event.organization | object | optional | A GitHub organization. Webhook payloads contain the |
github.event.repository | object | required | The repository on GitHub where the event occurred. Webhook payloads contain the |
github.event.sender | object | required | The GitHub user that triggered the event. This property is included in every webhook payload. |
github.event.sha | string | required | The Commit SHA. |
github.event.state | pending , success , failure , error | required | The new state. Can be |
github.event.target_url | string or null | required | The optional link added to the status. |
github.event.updated_at | string | required |