Skip to content

Commit 44115b0

Browse files
committed
fix(ci): fetch the base ref once, and stop swallowing the failure
The same `git fetch --depth=1 … 2>/dev/null || true` appeared in both base-ref audits. Fixing only the migration one would have left the identical defect a few steps above it. Neither audit can tell an absent base ref apart from a branch that changed nothing. The block-registry check at least degrades to a visible `⚠ Could not diff against base ref — skipping`; the migration audit printed `✓ No new migrations to check` and exited 0. Both now share one fetch step that fails the job when it fails.
1 parent cb74e15 commit 44115b0

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/test-build.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,22 @@ jobs:
104104
105105
echo "✅ All env flags are properly configured"
106106
107+
# One fetch for both base-ref audits, and no `|| true`: a swallowed fetch leaves
108+
# the base ref absent, which neither audit can tell apart from a branch that
109+
# changed nothing. The block-registry check at least degrades to a visible
110+
# `⚠ … skipping` line; the migration audit printed `✓ No new migrations to
111+
# check` and exited 0, clearing the only guard on production DDL.
112+
#
113+
# Depth stays at 1 — without a merge-base the migration audit diffs the two
114+
# tips, which under `--diff-filter=AM` is exactly the migrations new here.
115+
- name: Fetch base ref for diff-based audits
116+
if: github.event_name == 'pull_request'
117+
run: git fetch --depth=1 origin "${{ github.base_ref }}"
118+
107119
- name: Check block registry invariants
108120
run: |
109121
if [ "${{ github.event_name }}" = "pull_request" ]; then
110122
BASE_REF="origin/${{ github.base_ref }}"
111-
git fetch --depth=1 origin "${{ github.base_ref }}" 2>/dev/null || true
112123
else
113124
BASE_REF="HEAD~1"
114125
fi
@@ -126,14 +137,6 @@ jobs:
126137
- name: Verify docs manifest is in sync
127138
run: bun run docs-manifest:check
128139

129-
# Its own step, and no `|| true`: a swallowed fetch leaves the base ref absent,
130-
# which the audit cannot distinguish from a branch that changed no migrations.
131-
# The depth stays at 1 — without a merge-base the audit diffs the two tips,
132-
# which under `--diff-filter=AM` is exactly the migrations new on this branch.
133-
- name: Fetch base ref for migration diff
134-
if: github.event_name == 'pull_request'
135-
run: git fetch --depth=1 origin "${{ github.base_ref }}"
136-
137140
- name: Migration safety (zero-downtime) audit
138141
run: |
139142
if [ "${{ github.event_name }}" = "pull_request" ]; then

0 commit comments

Comments
 (0)