Skip to content

Run CI on code and the book on prose, not both on everything - #18

Merged
tschm merged 1 commit into
mainfrom
ci/path-filter-docs-and-code
Aug 30, 2026
Merged

Run CI on code and the book on prose, not both on everything#18
tschm merged 1 commit into
mainfrom
ci/path-filter-docs-and-code

Conversation

@tschm

@tschm tschm commented Aug 30, 2026

Copy link
Copy Markdown
Member

PR #17 changed only README.md, docs/, mkdocs.yml and one workflow — and still ran the collector lint and tests, compose parsing, the dashboard checks and CodeQL. None of them can say anything about a markdown file.

Splitting the README into docs/ makes that the common case rather than a one-off, and checks that routinely run over changes they cannot judge are checks people learn to skim past.

The split

The two workflows now divide the repo between them:

Runs on
ci.yml everything except **.md, docs/**, mkdocs.yml
book.yml exactly **.md, docs/**, mkdocs.yml — plus its own path

A mixed pull request still runs both. paths-ignore skips a workflow only when every changed file matches, so a commit touching the collector and its README is fully checked. That is the case that matters, and it is the default.

book.yml lists its own path so a change to the build steps is exercised by the PR that makes it — which is exactly what happens on this PR. Its **.md is deliberately broader than the site itself: it catches collector/README.md and the root README, neither of which is in the book, but a false positive costs one cheap 10-second build while a false negative ships a broken link.

The trap, recorded in ci.yml

main is unprotected today (confirmed: the protection API returns 404), so a skipped workflow costs nothing. If required status checks are ever turned on, a workflow skipped by a path filter never reports at all and the merge button blocks forever. The fix then is a same-named no-op job — not deleting the filter. That is written into the workflow header rather than left to be rediscovered, since this repo grew a branch-protection metric two PRs ago and may well turn protection on.

Verification

  • Both files parse, and the resulting trigger blocks are exactly as intended.
  • This PR is its own test case: it touches only .github/workflows/*.yml, so CI should run (workflow files are not prose) and Book should run (it lists its own path). If either is missing from the checks below, the filter is wrong.

🤖 Generated with Claude Code

PR #17 changed only the README, docs/, mkdocs.yml and one workflow, and
still ran the collector lint and tests, compose parsing, the dashboard
checks and CodeQL. None of them can say anything about a markdown file.
Splitting the README into docs/ makes that the common case rather than a
one-off, and checks that routinely run over changes they cannot judge
are checks people learn to skim past.

So the two workflows now split the repo between them: ci.yml ignores
`**.md`, `docs/**` and `mkdocs.yml`, and book.yml runs on exactly those.
A mixed pull request still runs both - `paths-ignore` skips a workflow
only when every changed file matches, so a commit touching the collector
and its README is fully checked.

book.yml also lists its own path, so a change to the build steps is
exercised by the pull request making it - which is what happens here.
Its `**.md` is deliberately broader than the site: it catches READMEs
that are not in the book, but a false positive costs one cheap build
while a false negative ships a broken link.

Recorded in ci.yml: main is unprotected today, so a skipped workflow
costs nothing. If required status checks are ever turned on, a workflow
skipped by a path filter never reports and blocks the merge button - the
fix then is a same-named no-op job, not deleting the filter.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tschm
tschm merged commit 10322b0 into main Aug 30, 2026
6 checks passed
@tschm
tschm deleted the ci/path-filter-docs-and-code branch August 30, 2026 11:51
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