Skip to content

ci: skip the test jobs on documentation-only pull requests - #58

Merged
sarseniy merged 1 commit into
mainfrom
ci/docs-only-prs
Nov 12, 2026
Merged

sarseniy merged 1 commit into
mainfrom
ci/docs-only-prs

Conversation

@sarseniy

@sarseniy sarseniy commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Branch protection on main required the test jobs of ci.yml. Its pull_request trigger skipped pull requests that change only Markdown or docs/, and a workflow skipped by a path filter never reports, so those required checks stayed pending forever. Every documentation-only pull request needed an admin bypass to merge.

Now ci.yml runs on every pull request, and a documentation-only one skips the test jobs:

ci (pull_request)
  changes                 # lists the PR's files via the API
    code = any file outside **.md, docs/**, .github/CODEOWNERS
  test, test-macos, test-core-only, test-missing-importorskip
    if: code
  tests-passed            # if: always()
    fails if any of the above failed or was cancelled
  coverage-comment        # skipped with `test`

Branch protection should require tests-passed instead of the six matrix legs (test / pytest (3.12) …). A skipped job never reports those names, because its matrix is never expanded. A skipped job does report success under its own name, so one aggregate check covers both cases. Adding a Python version or a test job then needs no change to the ruleset.

The push trigger keeps its path filter: a documentation-only commit on main does not change the coverage. The stale paragraph in docs-checks.yml that said a documentation-only pull request triggers no ci job is removed.

Evidence

  • Before: on a pull request that changes only README.md, test / pytest (3.12) and the other required ci checks wait for a status that never comes, and the merge is blocked.
    After: the same pull request runs changes (code=false) and tests-passed, two short jobs, and no test job. This can only be observed on the first documentation-only pull request after the merge: a pull request runs the ci.yml of its merge commit.
  • This pull request changes a workflow file, so here code=true and the full suite runs as before, with tests-passed on top.
  • The file filter, checked locally: README.md, docs/index.md, .github/CODEOWNERS → false; README.md, src/eigenkit/a.py → true; docs.py → true.
  • actionlint and pre-commit pass on ci.yml.

Merge Danger

Door: two-way

Blast Radius: CI

After the merge, swap the six test checks in the main ruleset for tests-passed. Until then, documentation-only pull requests stay blocked as before. If the filter misclassifies a change as documentation-only, its tests do not run. Only **.md, docs/** and .github/CODEOWNERS count, the same paths ci.yml ignored before. A failed API call fails changes, and with it tests-passed. A cancelled run fails tests-passed instead of skipping it.

@sarseniy
sarseniy requested a review from a team as a code owner November 12, 2026 13:58
@github-actions

Copy link
Copy Markdown

Docs preview: https://pr-58.eigenkit-docs.pages.dev

@sarseniy sarseniy changed the title ci: run the test jobs on documentation-only pull requests ci: skip the test steps on documentation-only pull requests Nov 12, 2026
Branch protection on main required the test jobs of ci.yml, but the
pull_request trigger skipped Markdown and docs/ changes. A workflow
skipped by a path filter never reports, so the required checks stayed
pending and a documentation-only pull request could not merge without
a bypass.

Drop the path filter from the pull_request trigger. A `changes` job
lists the files of the pull request; when they are all Markdown, docs/
or CODEOWNERS, the test jobs are skipped. A `tests-passed` job passes
when every test job passed or was skipped, and fails when one failed or
was cancelled. Branch protection requires that one check instead of the
six matrix legs, which a skipped job never reports. The push trigger
keeps its path filter.
@sarseniy sarseniy changed the title ci: skip the test steps on documentation-only pull requests ci: skip the test jobs on documentation-only pull requests Nov 12, 2026
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@sarseniy
sarseniy merged commit 89832fe into main Nov 12, 2026
17 checks passed
@sarseniy
sarseniy deleted the ci/docs-only-prs branch November 12, 2026 14:18

This branch was successfully deployed

1 active deployment
docs-preview — 6922118e Deployed Nov 12, 2026 by sarseniy via preview #81
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