| Event type | When to use | Example filter |
|---|---|---|
push | Run on commits or tags pushed to a repository (also when creating a repo from a template) | branches: [main], tags: ['v*'] |
pull_request | Run when pull requests change state (opened, reopened, review requested, etc.) | types: [opened, reopened, review_requested] |
schedule | Run workflows on a cron schedule | cron: '30 5 * * *' |
issues / discussion | Trigger on issue or discussion activity | issues: types: [opened, labeled] |
repository_dispatch | Trigger workflows from external systems using the REST API | types: [test_result] |

Push events
Use thepush event to run workflows when commits or tags are pushed to a repository. Common filters include branch names and tag patterns. This trigger is ideal for CI runs, deployments on main branches, and building versioned artifacts when tags are pushed.
Example — trigger on pushes to main or on tags that start with v:

Pull request events
Thepull_request event runs workflows when pull requests change state — for example: opened, reopened, closed, labeled, assigned, or when a review is requested. You can filter by specific types and inspect the payload through the github context inside workflow jobs.
Example — run on selected pull request activity and check whether a review from a specific team was requested:

Scheduled events (cron)
Use theschedule trigger to run workflows at fixed times. Cron schedules must be quoted in YAML because the asterisk (*) is a special character in YAML.
When you use cron schedules in YAML, wrap the cron string in quotes so the YAML parser treats the asterisks (
*) as part of the string.Issues and discussions
Trigger workflows from activity on GitHub Issues and Discussions. Use these events to automate triage, label management, welcome messages, or run bots that respond to user input. Example — listen for a subset of issue and discussion activity:

External events: repository_dispatch
When an event originates outside GitHub (for example, a database update, an external CI system, or another application), use therepository_dispatch event. Your external system calls the GitHub REST API to send a dispatch with a custom event_type, and a workflow configured for that event_type runs in the repository.
Example — trigger a workflow for an external event named test_result:
POST /repos/OWNER/REPO/dispatches with an event_type. Example curl call:
Make sure the token you use has the
repo scope (or repository permissions appropriate for the target repository). Also verify repository settings and branch protection rules if your workflow needs write access to the repository.Best practices and tips
- Limit event types and apply filters (
branches,tags,paths,types) to avoid running unnecessary workflow runs and reduce usage. - For
pull_request, preferpull_request_targetcarefully for actions that require repository write access; be mindful of security implications. - Use
repository_dispatchonly when external systems need to orchestrate GitHub-run workflows; secure tokens and limitevent_typevalues. - Validate cron expressions and consider timezone implications — GitHub Actions uses UTC for scheduled events.