open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

ci: add paths-ignore to skip CI on documentation-only changes

Open lizhengfeng101 opened this issue 3 months ago • 3 comments

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.push and on.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 by verify-english-only.go
  • .github/workflows/** — workflow changes should always trigger CI
  • action.yml — checked by verify-action-pins.sh

Acceptance Criteria

  • [ ] Add paths-ignore to both on.push and on.pull_request triggers
  • [ ] 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.

lizhengfeng101 avatar Aug 14 '26 09:08 lizhengfeng101

Happy to take this up! cc @lizhengfeng101

Shaurya2k06 avatar Aug 14 '26 09:08 Shaurya2k06

@Shaurya2k06 Hi~ I'm working on this one.

yingjiexu2002 avatar Aug 14 '26 09:08 yingjiexu2002

Sounds good!

Shaurya2k06 avatar Aug 14 '26 09:08 Shaurya2k06