Repository navigation
Skip CI jobs whose exact inputs already passed - #143
Merged
Merged
Conversation
NinjaLikesCheez
added this pull request to stack #145
October 19, 2026 07:39
Path filters compared the whole PR against main, so every push (even one that only adds a CHANGELOG entry) re-ran just check and the Docker build, and skipped jobs still started a runner. Each workflow now hashes the files a job depends on (.github/path-filters.yml plus the workflow) and skips the job when a cache marker says that exact set already passed. CD publishes when the image inputs differ from the last publish. Terraform plans that aren't needed never start. The changelog gate drops pnpm install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/ci-inputs.test.ts reads the Dockerfile and the cd, docs and terraform workflows, so a PR touching only those skipped the tests that guard them. Add them to the check list, with a test that keeps it so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NinjaLikesCheez
force-pushed
the
ci/skip-passed-inputs
branch
from
October 19, 2026 07:51
b28af1e to
77d9988
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Pushing only a CHANGELOG entry to a PR re-ran Lint, typecheck, test, build and Docker image builds.
dorny/paths-filtercompares the whole PR againstmain, so once a PR touchessrc/, every later push matches. Jobs that were "skipped" also still started a runner just to echo "Skipping". The Terraform plan jobs started (and could wait on an Environment approval) even when they then did nothing.What changes
Content-addressed gate instead of path diffs. Each workflow's first job (
What changed) hashes the files a job depends on: a list in.github/path-filters.yml, plus the workflow file, the filter file and the gate itself (scripts/ci-inputs.sh, which usesgit ls-files -s, so paths, modes and contents all count). It then looks the hash up as a tiny Actions cache marker (.github/actions/ci-inputs). A job runs only if that exact set of files has never passed, and it saves the marker on success (.github/actions/ci-passed).main's markers (PRs can read the base branch's caches), so check and Docker skip.if:, so no runner starts. GitHub reports them as passed. TheProtecc Mainruleset is disabled today, and a skipped job satisfies required checks anyway.Per workflow
checkanddockerare gated as above. Theimagelist is what the Dockerfile copies, without tests (*.test.ts,src/testing/), so test-only changes don't rebuild.justfileandci.ymlno longer count as image inputs for CD.pull-requests: readis dropped (it was only for dorny).match: latest, which publishes when the image inputs differ from the most recent publish. A revert to older code therefore republishes, and a run cancelled by a newer merge leaves the newer one to publish. The marker is saved only after the image and the Sentry maps are done.docslist. Thepaths:trigger now also covers rootpackage.json/lockfile/biome.json, which the site and its Biome lint read. Publishing (workflow_dispatch) always builds.changesjob. Plan jobs are skipped at job level, so they never wait on thedev/prodEnvironment when there's nothing to plan. Validate and plans skip when theterraforminputs already passed.pnpm install(scripts/check-changelog.tsonly uses Node built-ins and Node 24 runs the TS itself).just check-changelognow usesnodedirectly.Guard rails:
scripts/ci-inputs.test.tstests the hasher in a temp repo (exclusions, renames, extra files, unknown list). On the real repo it checks that everything the DockerfileCOPYs is inimage, that everyfilter:a workflow uses exists, and that thepaths:triggers of docs.yml and terraform.yml cover their lists.just ci-inputs <list>prints what a list matches.Trade-offs / notes
ci-passed-…cache (Actions → Caches) and re-run, or change a file. The runbook covers this. Markers are evicted after 7 days unused, and then the job simply runs again.main, CI still runs once, because PR markers aren't visible tomain. That run seeds the markers future PRs reuse. The Docker smoke onmainoverlaps with CD's build, but both share the GHA layer cache.cd.ymlto stop CD losing images by queueing runs and diffing against the last green run. This PR solves the same problem through thelatestmarker, so thecd.ymlhalf of Stop CD losing images and gate Release on just check #137 becomes unnecessary. Its Releasejust checkgate is unaffected.docs/architecture.md,docs/runbook.mdanddocs/infra.md. CHANGELOG entry is under Changed.Verified
just checkpasses (includes the new tests).just docs-buildpasses.actionlintis clean apart from a pre-existing SC2129 style note inrelease.yml, which this PR doesn't touch.🤖 Generated with Claude Code