Blog

Eight false skips we fixed before cigen ran in anyone else's CI

A CI job that skips when its inputs changed turns a real failure into a green check. We found eight ways cigen could do that, and fixed each one with a test that fails on the old code.

cigen skips a CI job when everything the job depends on is exactly what it was when the job last passed. Getting that wrong in one direction costs a few minutes: a job runs that didn’t need to. Getting it wrong in the other direction is a false skip: the job’s inputs changed, it didn’t run, and the check is green anyway. A broken test suite looks like a passing one, and nobody finds out until the failure turns up somewhere more expensive.

That asymmetry is the main rule in cigen’s codebase: “A false skip is the worst bug cigen can have.” Any change to hashing, keys or skip conditions has to come with a test that changes an input and checks that the job runs. In December 2026, while rebuilding cigen in the open, we found eight false skips. None could reach another project’s CI: generated workflows install cigen from its v0.2.0 release, which isn’t out yet. Here is each one, what caused it, and the test that now catches it.

1. The cache key that never changed

cigen’s GitHub Actions output records a pass as a marker in the Actions cache, under a key that includes the job’s hash. The provider built that key with Rust’s format!, and in format! a pair of braces is an escape for one brace. ${{ steps.hash.outputs.job_hash }} came out as ${ steps.hash.outputs.job_hash }, which GitHub doesn’t treat as an expression. Every run of a job used the same literal key, so after its first green run the job skipped forever, whatever changed.

The fix was four braces in the Rust source, plus a unit test of the exact rendered string. The longer-term fix was mockci, a test-only GitHub Actions simulator that runs generated workflows against real git repositories, with a model of the cache. Put the constant key back and four of its eight original skip scenarios fail (d5e6bdc, 9c5d5bc).

2. Inputs nobody declared

A job’s hash covered its own definition and the files listed in its inputs. A job that runs sh scripts/check.sh depends on that script, and on the toolchain pin and lockfile, and on any reusable command it calls. If those weren’t listed, changing them left the job skipping.

Asking people to list every file is how path filters fail, so cigen now derives those inputs itself. On top of what a job declares, cigen hash --job adds the commands it uses, the services it names, the top-level provider blocks, every project file its steps name, the files of local actions, and the root toolchain pins and lockfiles. Each rule includes too much rather than too little. With derivation turned off, seven of the eight new tests fail (#6).

3. Step keys that vanished

The step schema kept only the keys cigen modelled. Anything else on a step, such as if:, id:, shell: or continue-on-error:, was dropped before the provider saw it, and left out of the job’s hash. So changing a step’s if: didn’t change the hash, and the job skipped. In cigen’s own release workflow, if: runner.os == 'Linux' had disappeared from the output, so a Linux-only step ran on every platform.

Steps now keep every key they’re given, the keys are hashed, and the GitHub provider rejects a key a GitHub step can’t have. A mockci scenario changes a key cigen doesn’t model and checks that the job runs (#12).

4. Globs that missed files

A glob like **/*.md was passed to git ls-files as a plain pathspec. Without git’s glob magic, **/ can’t match zero directories, so **/*.md missed README.md at the root, and docs/**/*.md missed docs/a.md. Changing those files skipped the job. We found this one while converting a real project’s CI for a case study.

Every glob cigen hashes now goes through one matcher with gitignore’s rules, inside git and outside it, and tests/glob_inputs.rs changes a file for each rule and checks whether the hash changes. While fixing it we found a related problem hiding behind it: in a CI container job git refuses to run in a checkout owned by another user, and cigen had been silently falling back to globbing the files on disk, build output included. cigen now runs git with safe.directory set and fails loudly on any other git error (#28).

5. Jobs that depend on other jobs

When test needs build and uses its artifact, a change to build’s inputs alone made build run while test skipped on its own unchanged hash, so the new artifact was never tested. A job’s hash now ends with the hashes of every job it needs, transitively. A mockci scenario changes only build’s input and checks that test runs (#30).

6. Scripts in package.json

Of package.json, only the packageManager field was a derived input. A job that runs npm run test depends on the test script, so editing the script left the job skipping. Every tracked package.json is now in every job’s hash, the same over-inclusive rule as lockfiles, because cigen can’t tell which job runs a package manager in which package. A mockci scenario changes the root’s test script, then a sub-package’s, and checks that the job runs both times (#38).

7. Matrix entries that shared one pass

A job can pass GitHub’s own strategy: matrix through its github: block. Every entry of the matrix got the same hash and the same skip key, so when nightly failed and stable passed on one commit, the next commit with unchanged inputs had nightly restore stable’s pass and turn green. We found it converting ripgrep’s CI for a case study, where 14 Linux entries of one job would have shared a key.

Each entry now goes into the job’s hash: the hash step receives toJSON(matrix) in an environment variable, and cigen hash --matrix mixes the entry’s canonical JSON into the digest, so the hash, the cache key and the pass all name one entry (#51).

8. Our own test job

The last one was in cigen’s own CI. We taught the docs test to run the configs in the case studies, but didn’t add the case studies to the inputs of cigen’s test job. A commit that broke only a case study would have skipped the test that checks it. We found it while checking that a different skip was legitimate (it was).

The fix was one line of config. The guard is a test that expands the test job’s inputs and fails if any file the docs test reads isn’t among them, so the next directory someone adds to the docs test has to be an input too (#53). The posts on this blog are inputs for the same reason.

What they have in common

Seven of the eight have the same shape: the job’s result depended on something its hash didn’t cover. The format! bug is the odd one out, a rendering mistake, and it was the easiest to miss because the output looked right at a glance. Number 8 shows the shape doesn’t go away when you know about it: we wrote the rule, and still broke it in our own config.

Each of them is the kind of bug a hand-written skip system is likely to have, and most of them are silent: CI stays green. That’s the case for one shared, tested implementation over a few hundred lines of hashing copied into each repo. cigen still has known gaps, and they’re listed rather than hidden: a moving image tag such as rust:latest isn’t resolved to a digest, and files that a named script mentions aren’t followed (derived inputs). On GitHub Actions a skipped job still starts a runner today; a planner job that decides before any job starts is next.