Skip to content

Build Not yet confirmed elsewhere1 publisher 2 min read Published

A one-commit checkout and a trailing || true let 41 PRs skip tests under green CI

GitHub Actions' default one-commit checkout let 41 pull requests skip their tests over three weeks while CI stayed green, a dev.to author reports. The author's change-detection step read git's fatal error as an empty diff, and the run that exposed it showed a test job that finished in 4 seconds.

The Engineer · Build desk

How we use AI Send a correction

Git diff errored, tests were skipped, CI showed green From a dev.to author's report: the skipped test job's time, git diff's exit code on a depth-1 checkout, and files in the PR that broke main.

Key figures: in the run that exposed the problem, the test job finished in 4 seconds, printing 'No code changes, skipping tests'. git diff origin/main...HEAD exited 128 on a depth-1 checkout. The PR that broke main after a green CI run changed 14 files in src/.

Git diff errored, tests were skipped, CI showed green
FigureValueNoteClaim
Test job time in the run that exposed the problem4 seconds10
git diff exit code128 exit code2
Files changed in src/14 files11

What happened

  • With a depth-1 checkout there is no origin/main ref, so git diff origin/main...HEAD prints a fatal error and exits 128.
  • On a pull_request event the one fetched commit is GitHub's merge commit at refs/pull/<N>/merge, which merges the PR head into the current base.
  • The step ran as bash -e without pipefail, so grep's status won, and the trailing || true then swallowed both git's fatal error and grep's no-match.
  • It surfaced on a Tuesday, when a PR that changed 14 files in src/ broke main after a green CI run.

Why it matters

  • exposure Any step that diffs against a base ref, reads tags or counts commits on the default checkout is affected. git rev-list --count returns 1 without an error, so version strings can fall back to a first-release default.
  • cost Full history costs clone time on every run, and the post names that as the price of fetch-depth: 0. The depth-2 variant avoids it but is scoped to pull_request events.
  • decision Teams with skip logic have to choose what happens when the diff cannot be computed. We think a change-detection step that errors should run the full suite or fail, never skip.

Fetching full history makes origin/main exist, but the step would still treat any git failure as an empty diff [7][8]. That is why the post's fix has two parts: more history first, then a step that stops the job when git errors [16][17].

Setting pipefail by itself would not close it. The `|| true` sits after the pipeline, and bash returns success from `pipeline || true` whether the pipeline passed or failed [19]. Bash did what it was told. The only case that needs a guard is grep's exit 1 on no match [8], so in our view the right shape is `git diff` on its own line under errexit, with `|| true` attached to grep alone.

The 41 PRs over three weeks work out to about 14 a week [18]. Each of them went green [12]. The post's author wrote that git's fatal message sat in the log as "gray text above a green checkmark" [13]. The step also passes on a laptop, because a local clone has origin/main and full history [3]. Running the script by hand will not reproduce the failure.

All of this rests on one author's repository. The 41 count and the three-week window are the author's own numbers, and the post does not say how many of those 41 PRs would have failed their tests. The author bets that many monorepos carry some version of the same step [20]. That is a guess, not a survey.

For the finding to transfer, a workflow needs the default checkout, a diff against a remote ref, and a fallback that treats an error as empty output. A workflow that already sets fetch-depth: 0 does not hit the missing ref [16]. The author's throwaway workflow tests for the first condition. On a repo with years of history it printed true for is-shallow-repository, a log of one commit, one remote ref and zero tags [5].

What to watch

  • Whether other teams report the same fail-open pattern in their change-detection steps, since the evidence so far is one repo.
  • Whether monorepo affected-only runners fail closed when the base ref is missing; the post says to check for a 'fall back to running nothing' mode.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence62
Adoption
Insufficient
Hype gap+6
Incentives
Insufficient
Confidence60
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    actions/checkout defaults to fetch-depth: 1, which fetches one commit with no parents, no other branches and no tags.

    Reported Supported Source: dev.to post by its author2 sources— create a free account to open themView cited source
  2. [2]

    With a depth-1 checkout there is no origin/main ref, so git diff origin/main...HEAD prints 'fatal: ambiguous argument' and exits 128.

    Reported Supported Source: dev.to post by its author2 sources— create a free account to open themView cited source
  3. [3]

    The step works on a laptop because a local clone has origin/main and full history; it only breaks on the runner.

    Reported Supported Source: dev.to post by its author2 sources— create a free account to open themView cited source

Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.

Add to ChatGPTAdd to Claude

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · October 13, 2026

    GitHub Actions fetch-depth: 1 Made My CI Skip Tests for 41 PRs

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Topics

Loading related stories