Skip workflows that don't apply
The simplest dynamic matrix is 'skip the workflow entirely if the change doesn't touch what this workflow tests'. paths: and paths-ignore: under an event filter the entire workflow.
Patterns
- Glob:
'src/**','**/*.py'. - Multiple:
['src/**', 'tests/**']. - Negation isn't supported in the YAML filter; use
paths-ignoreinstead.
What gets evaluated
The diff between the previous SHA and the new push (or between the PR base and head). If any changed file matches the filter, the workflow runs. Otherwise it doesn't trigger at all.
Path filters interact with required checks
If a workflow that's a required status check is filtered out by paths, the check won't fire — but it's still 'required'. PRs that don't touch matching files will hang. Solutions:
- Configure 'Allow merging if status checks are skipped' (depends on policy).
- Use a no-op fallback workflow that always reports green.
- Use
paths-filteraction inside the job, not at the workflow level.