ci: Skip the build and tests on docs-only PRs - #175
Conversation
Every release blog PR changes only documentation, yet ran the full build, all eight test projects, coverage and CodeQL, about 17 runner-minutes each. The build and test jobs can't be left out with paths-ignore, because Build Solution and Test Suite are required checks and a check that never reports blocks the merge. A new Detect Changes job classifies the PR's files. When every one is Markdown or under docs/, the build, test matrix and coverage are skipped, which counts as passing for a required check. Anything else, including workflows and scripts, runs the full suite, as do pushes and manual runs. Test Suite still fails on any failed or cancelled job, and also when Detect Changes itself didn't succeed, so the build can't be skipped by mistake. CodeQL's pull_request trigger ignores docs and Markdown; main's push and weekly runs still cover the code. Fixes #173 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
=======================================
Coverage 85.40% 85.40%
=======================================
Files 77 77
Lines 1596 1596
Branches 150 150
=======================================
Hits 1363 1363
Misses 189 189
Partials 44 44 |
|
Docs-only path checked live on #176 (a draft PR changing only |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Rename detection can classify removal of a source or configuration path as docs-only and incorrectly skip required validation.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds docs-only PR detection to reduce unnecessary CI work while preserving required checks.
Changes:
- Skips builds, tests, coverage, and CodeQL for documentation-only PRs.
- Keeps
Test Suitereporting and fail-safe status checks. - Adds conservative full-suite handling for other events and empty diffs.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Detects docs-only changes and gates expensive jobs. |
.github/workflows/codeql-analysis.yml |
Excludes documentation-only PRs from CodeQL. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
git diff --name-only reports a rename under its new path only, so moving a source file into docs/ or to a .md name looked docs-only and skipped the build and tests. --no-renames lists the removed path too. Addresses Copilot review on #175. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* ci: Skip the build and tests for docs-only pull requests A Detect Changes job classifies the PR's files. When every path is under docs/ or ends in .md, as in a release blog PR, the build is skipped and the test matrix and coverage skip with it. A skipped required check counts as passing, so the PR still merges. Test Report Summary fails if the detection itself failed. CodeQL ignores docs-only PRs too. Port of mpaulosky/IssueTracker#175. Refs #86 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: Classify a PR's changed files in a tested script detect_changes.py holds the docs-only rule the Detect Changes job used to run inline: every path under docs/ or ending in .md skips the build, and anything else, an empty diff or a rename out of code runs it. Its tests build real git repos to cover docs-only, code, mixed, empty, rename, delete and odd-filename changes. Refs #86 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Summary
Every release blog PR changes only documentation (
docs/blogs/,README.md,docs/README.md), yet ran the full build, all eight test projects, coverage and CodeQL: about 17 runner-minutes each (#167, #169, #171).paths-ignorecan't skip them, becauseBuild SolutionandTest Suiteare required checks, and a check that never reports blocks the merge.Detect Changesjob (ci.yml) classifies the PR's changed files. When every one is Markdown or underdocs/,Build Solution, the test matrix and coverage are skipped. GitHub counts a required check skipped by itsif:as passing, andpr-automerge.ymlrelies on GitHub'sCLEANmerge state, which does the same..cs, project files) runs the full suite, as do pushes and manual runs. An empty diff runs it too. Renames are listed under both paths (--no-renames), so moving code intodocs/or to a.mdname still runs the suite.Test Suitestays honest: it still fails on any failed or cancelled job, and also whenDetect Changesitself didn't succeed, so the build can't be skipped by mistake. On a docs-only PR its summary says the build and tests were skipped.docs/**and**/*.mdonpull_request. It isn't a required check, andmain's push and weekly runs still cover the code.Testing
--no-renamesconfirmed to list both paths whensrc/a.csis moved todocs/a.md): a blog-PR-shaped change anddocs/index.html→ docs-only. A.csfile, a workflow, Markdown plus code, a file nameddocs.md.cs, and an empty diff → full suite.yamllint,actionlintandzizmorare clean, andscripts/gate.shpassed.Fixes #173
🤖 Generated with Claude Code