GitHub Actions · Lesson 2 of 10 · 3 min read
Events and triggers
Common events
| Event | Use | Notes |
|---|---|---|
push |
CI on branches, deploy on main, release on tags | Filter by branches, tags, paths |
pull_request |
PR validation | Runs in the context of the PR's merge commit; fork PRs get no secrets and a read-only token |
pull_request_target |
Labelling/commenting on fork PRs | Runs in the base repo context with secrets — never check out and run PR code here (see security) |
workflow_dispatch |
Manual runs with typed inputs |
Deploy buttons, maintenance jobs |
schedule |
Cron (UTC) | Nightly scans, drift detection; may be delayed under load; disabled after 60 days of repo inactivity in public repos |
workflow_call |
Makes the workflow reusable | Called by other workflows |
workflow_run |
Run after another workflow completes | Chaining; has security caveats similar to pull_request_target |
release, create, delete, issues, issue_comment |
Release automation, ChatOps | |
repository_dispatch |
External systems trigger via API | Cross-repo orchestration |
merge_group |
Required for merge queues | Run checks on the queued merge commit |
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
Filtering and control
on:
push:
branches: [main, "release/**"]
tags: ["v*.*.*"]
paths-ignore: ["docs/**", "**.md"]
workflow_dispatch:
inputs:
environment:
type: choice
options: [staging, prod]
required: true
dry_run:
type: boolean
default: true
paths/paths-ignore— monorepo-friendly triggers. (A workflow skipped by path filters doesn't report a status — required checks need care: use a job that always runs and decides, or tools like dorny/paths-filter inside the workflow.)concurrency— at most one running instance per group;cancel-in-progress: truefor PRs,falsefor deployments (don't cancel a half-finished deploy; queue instead).
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.