Skip to content

CI: skip the build on pull requests that change only documentation - #287

Open
sombraSoft wants to merge 1 commit into
ivall:mainfrom
sombraSoft:ci/path-filters
Open

sombraSoft wants to merge 1 commit into
ivall:mainfrom
sombraSoft:ci/path-filters

Conversation

@sombraSoft

@sombraSoft sombraSoft commented Nov 23, 2026 •

Copy link
Copy Markdown

Pull requests that change only documentation skip the Windows build, and the required check still reports.

Part of #265

A light changes job reads the PR's file list (the same API call PR checks makes). The build job's if: skips the build when every file is safe to skip: docs/, top-level .md, the PR / issue templates, pr-check.yml, LICENSE and .gitignore. Any other file, a push to main, or a list that cannot be read runs the build.

The on: triggers are unchanged. A job skipped by its if: reports success to a required check (GitHub docs); a workflow-level paths filter would leave it pending forever.

What is in it

CI time

  • +5–7 s before the build starts, for the changes job (Ubuntu). A docs-only PR skips the Windows build entirely (~1.5–2.5 min).

Tested

  • Fork, a PR changing ci.yml: https://github.com/sombraSoft/xcl/actions/runs/45278328881. Changed files and the build both ran, green.
  • Fork, a PR changing only docs/wave64-on-wave32.md: https://github.com/sombraSoft/xcl/actions/runs/45278397518. Changed files was green (rust=false), the build showed as skipped, and the run was green.
  • The shell logic, run locally against these cases: docs only, mixed, nested .md, scripts/, Cargo.lock, rename into docs, empty list, API failure and push.
  • Full suite on main (9ab7d76), RTX 3060 Ti (driver 621.24), Ryzen 9 5900X, Windows 11, rustc 1.97.1, debug: scripts/test.ps1 → 651 passed, 0 failed, 40 ignored; SKIPPED: 2 (no wave64). This PR changes only CI config, so the compiled code is the same.

Regression run

  • Not needed: no crates/xcl/src change.

Not tested

  • Upstream branch protection is not visible to me. The build job's name is unchanged, so its required check context is the same.
  • A real failure of the changes job; that case is covered by the local API-failure test and the !cancelled() condition.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and this description; I read the diff.

A docs-only PR waits about half an hour for a Windows build whose result cannot differ
from main's. A light `changes` job reads the PR's file list (the same API call PR checks
makes) and the build job's `if:` skips it when every file is on a safe-to-skip list: docs/,
top-level .md files, the PR / issue templates, pr-check.yml, LICENSE, .gitignore. Anything
else, a push to main, or a list that cannot be read runs the build.

The `on:` triggers stay as they are: a job skipped by its `if:` reports success to a
required check, while a workflow skipped by a `paths` filter leaves it pending forever.
The build's `if:` starts with !cancelled() so a failed `changes` job runs the build instead
of skipping it (a job whose `needs` failed is otherwise skipped, which also reads as
success). The `scripts` output is for a job that tests scripts/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant