How to Skip CI on Docs-Only Changes in GitHub Actions
A paths-ignore filter keeps the workflow from triggering when a push touches only documentation files.
Add paths-ignore under the push and pull_request events listing your docs globs. A commit that changes only those files does not start the workflow.
Steps
- Add
paths-ignore:underon.pushandon.pull_request. - List docs globs such as
**/*.mdanddocs/**. - Keep code paths uncovered so real changes still trigger CI.
Workflow
.github/workflows/ci.yml
on:
push:
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.github/ISSUE_TEMPLATE/**'
pull_request:
paths-ignore:
- '**/*.md'
- 'docs/**'Gotchas
- If the workflow is a required check, a skipped run can block merges; pair it with a placeholder that reports success.
- A commit that touches both code and docs still runs, since not all paths are ignored.
Related guides
How to Cancel Superseded Runs With Concurrency in GitHub ActionsStop wasting minutes on outdated commits by grouping runs per branch with a concurrency block and cancel-in-p…
How to Run Only Affected Jobs on Changed Paths in GitHub ActionsSkip unrelated work in a monorepo by detecting which paths changed with a filter action, then gating each dow…