Skip to content

Commit 4b3d90b

Browse files
committed
fix(ci): give push builds the parent commit their audits diff against
Push builds fail the migration audit: ✗ Migration safety check could not run. Cannot diff against 'HEAD~1'. `actions/checkout` sets no `fetch-depth`, so it defaults to 1 — a single-commit clone in which `HEAD~1` does not resolve. Both diff-based audits name `HEAD~1` as their base on push events, so neither has ever had a base to read. The migration audit used to answer that with `✓ No new migrations to check` and exit 0, so it had never run on a push build at all; #7022 made it say it could not run instead, which is what surfaced this. The block-registry check has the same input and reports `⚠ … skipping` — visible, but also never run on push. `fetch-depth: 2` on the audit job's checkout gives `HEAD~1` something to name. Verified in a two-commit repo: at depth 1 `git rev-parse HEAD~1` does not resolve, at depth 2 it does and `git diff HEAD~1 HEAD` reports the change. Both audits pass against `HEAD~1` on a checkout with history. Only the audit job changes; Build App keeps its depth-1 checkout.
1 parent 67fc2ae commit 4b3d90b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/test-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@ jobs:
1414
timeout-minutes: 15
1515

1616
steps:
17+
# The diff-based audits below name `HEAD~1` as their base on push events,
18+
# and the default depth of 1 clones a single commit with no parent for that
19+
# to resolve to. The migration audit read the resulting `git diff` failure
20+
# as "no migrations changed" and exited 0, so it had never actually run on
21+
# a push build; it now reports that it cannot run, which is what surfaced
22+
# this.
1723
- name: Checkout code
1824
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
25+
with:
26+
fetch-depth: 2
1927

2028
- name: Setup Bun
2129
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2

0 commit comments

Comments
 (0)