How do path filters work, and what are their limits?
AdvancedConceptTriggers & Events
Answer
paths runs the workflow only if at least one changed file matches; paths-ignore skips if all changed files match. Combined with branches, both must match. Limits that bite:
- Only the first 300 changed files in a diff are evaluated, so huge PRs may not trigger.
- On
pushof a new branch, the diff is computed against the default branch tip or is unavailable, so behaviour can differ. - Tag pushes ignore path filters (paths do not apply to tags).
- A workflow skipped by path filters never reports a check, so a required check stays "Expected — Waiting for status to be reported".
More on Triggers & Events
How do you trigger a workflow on pushes to `main` and on PRs that target `main`?BeginnerWhat activity types does `pull_request` trigger on by default, and how do you add more?IntermediateHow do `branches` and `branches-ignore` filters work with globs?BeginnerHow do you trigger only on version tags, and what is the gotcha with pushing many tags?IntermediateWhat is `workflow_dispatch`, and what input types does it support?BeginnerWhy does `github.event.inputs.dry_run == true` never match, while `inputs.dry_run` works?Intermediate