Skip to main content

Events that trigger workflows

You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs.

About events that trigger workflows

Workflow triggers are events that cause a workflow to run. For more information about how to use workflow triggers, see Triggering a workflow.

Some events have multiple activity types. For these events, you can specify which activity types will trigger a workflow run. For more information about what each activity type means, see Webhook events and payloads.

Note

Not all webhook events trigger workflows.

Like GitHub Actions workflows, agentic workflows can be triggered by repository events and schedules. For an example, see Creating GitHub Agentic Workflows.

branch_protection_rule

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
branch_protection_rule- created
- edited
- deleted
Last commit on default branchDefault branch

Note

  • More than one activity type triggers this event. For information about each activity type, see Webhook events and payloads. By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see Workflow syntax for GitHub Actions.
  • This event will only trigger a workflow run if the workflow file exists on the default branch.

Runs your workflow when branch protection rules in the workflow repository are changed. For more information about branch protection rules, see About protected branches. For information about the branch protection rule APIs, see Branches in the GraphQL API documentation or REST API endpoints for branches and their settings.

For example, you can run a workflow when a branch protection rule has been created or deleted:

on:
  branch_protection_rule:
    types: [created, deleted]

check_run

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
check_run- created
- rerequested
- completed
- requested_action
Last commit on default branchDefault branch

Note

  • More than one activity type triggers this event. For information about each activity type, see Webhook events and payloads. By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see Workflow syntax for GitHub Actions.
  • This event will only trigger a workflow run if the workflow file exists on the default branch.
  • To prevent recursive workflows, this event does not trigger workflows if the check run's check suite was created by GitHub Actions or if the check suite's head SHA is associated with GitHub Actions.

Runs your workflow when activity related to a check run occurs. A check run is an individual test that is part of a check suite. For information, see Using the REST API to interact with checks. For information about the check run APIs, see Checks in the GraphQL API documentation or REST API endpoints for check runs.

For example, you can run a workflow when a check run has been rerequested or completed.

on:
  check_run:
    types: [rerequested, completed]

check_suite

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
check_suite- completedLast commit on default branchDefault branch