Skip to content

ci: run a job on a pull request only when it changes a path the job reads - #260

Merged
ademariag merged 1 commit into
kapicorp:mainfrom
Moep90:ci/path-filtered-jobs
Oct 27, 2026
Merged

ademariag merged 1 commit into
kapicorp:mainfrom
Moep90:ci/path-filtered-jobs

Conversation

@Moep90

@Moep90 Moep90 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

On a pull request, each CI job now runs only when the change touches a path that job reads. A new Changed paths job diffs the PR against its base, the same way deny already did, and every other job is gated on its output. A push to main, or a PR that changes ci.yml, still runs every job.

The path list is in docs/specs/cli-and-release.md under "Job paths", as CLI-62. CLI-29 drops its own path rule and CLI-33 adds changes to the jobs CI passed depends on. CI passed already counts a skipped job as passed, so branch rules keep working unchanged.

Some examples: a docs-only PR runs only test, because docs_consistency.rs reads every markdown file. A fixture change runs test and parity. A .github/ change outside ci.yml runs only zizmor.

Verified

  • I extracted the run: script from the YAML and ran it locally against sample changes. Each one turned on the jobs listed in the spec table, and a push turned on all of them.
  • zizmor 1.31.1 over .github/workflows: no findings.
  • cargo test -p krab --test docs_consistency passes.
  • This PR changes ci.yml, so its own CI runs every job. The skipping only shows on PRs opened or rebased after it merges.

@Moep90
Moep90 force-pushed the ci/path-filtered-jobs branch from 14845ea to 56c59e6 Compare October 27, 2026 19:04
@github-actions github-actions Bot added documentation Improvements or additions to documentation area: packaging Crates, release binaries, CI labels Oct 27, 2026
@Moep90
Moep90 force-pushed the ci/path-filtered-jobs branch 2 times, most recently from 2ec45db to c2fc66f Compare October 27, 2026 19:27
…eads

A changes job diffs the pull request against its base, the way the deny job already did, and gates every other job on its own path list. A push to main, or a change to ci.yml, still runs everything. CLI-62 holds the path list. The test job also covers markdown, because docs_consistency.rs reads every markdown file.

Signed-off-by: moep90 <3042152+Moep90@users.noreply.github.com>
@Moep90
Moep90 force-pushed the ci/path-filtered-jobs branch from c2fc66f to 4e4da1c Compare October 27, 2026 19:55
@ademariag
ademariag merged commit a445f06 into kapicorp:main Oct 27, 2026
13 checks passed
Moep90 pushed a commit to Moep90/krab that referenced this pull request Oct 29, 2026
ci: run a job on a pull request only when it changes a path the job reads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: packaging Crates, release binaries, CI documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants