ci: add paths-ignore to skip CI on documentation-only changes
Description
The CI workflow (.github/workflows/ci.yml) currently triggers on every push to main and every PR targeting main, regardless of which files changed. This means documentation-only changes (e.g., fixing a typo in a README) spin up the full test suite unnecessarily.
Adding paths-ignore filters will save CI resources and reduce queue wait times for contributors making doc-only edits.
Scope
- File(s):
.github/workflows/ci.yml - Area: workflow trigger configuration (
on.pushandon.pull_request)
Analysis
Each CI step was reviewed to determine which file types actually matter:
| CI Step | Files scanned |
|---|---|
| License headers | .go .sh .js .mjs .ts .tsx |
| Action pins | action.yml only |
| English-only | .go .ts .tsx .js .cjs .mjs .py .sh .ps1 .css .html .yml .yaml .json + Makefile (explicitly skips .md) |
| gofmt / vet / test / build | *.go, go.mod, go.sum |
| Line endings | All git-tracked files (low risk for doc-only changes) |
| Cross-compile | *.go |
The following paths are safe to exclude — they are not scanned by any CI step:
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
Do NOT exclude:
.yml/.yaml— scanned byverify-english-only.go.github/workflows/**— workflow changes should always trigger CIaction.yml— checked byverify-action-pins.sh
Acceptance Criteria
- [ ] Add
paths-ignoreto bothon.pushandon.pull_requesttriggers - [ ] Paths listed above are excluded; no source-relevant paths are excluded
- [ ] CI still triggers correctly for code changes (verify with a test PR if possible)
- [ ] Code check passes (
make check)
Context
Discovered during a review of CI trigger behavior. The workflow runs on a self-hosted runner with --cpus=2, so avoiding unnecessary runs directly saves compute.
Happy to take this up! cc @lizhengfeng101
@Shaurya2k06 Hi~ I'm working on this one.
Sounds good!