Opscraft
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 diagrampushCI on branches, deploy main,release tagspull_requestvalidate PRs (forks: no secrets)schedulenightly scans, drift checksworkflow_dispatchmanual run with inputsworkflow_callreusable workflowmerge_groupchecks for merge queues
Figure 1. Common events and what teams use them for.
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: true for PRs, false for deployments (don't cancel a half-finished deploy; queue instead).
Enlarge diagramrun for commit 1cancelledrun for commit 2cancelledrun for commit 3runsdeploy v1finishesdeploy v2waits, then runsPull request (cancel-in-progress: true)Deploy (cancel-in-progress: false)
Figure 2. Concurrency groups: for PRs, a new push cancels the run already going; for deployments, runs queue so nothing is stopped half-way.
Swipe sideways to see all of it, or tap to open it full screen.