Skip to content

Commit a7dea3d

Browse files
authored
fix: [#781] marker-guard non-strict on bridge-merge push to main (#782)
The PR-side marker-guard already runs in non-strict mode for `upstream/merge-*` head_refs, but after a squash-merge of that PR, the push event to main has no head_ref / second-parent / branch-name signal — it falls back to `--strict` and fails on the hundreds of upstream files the bridge merge brings in (98 false-positive warnings on the v1.4.0 bridge merge, run 25264283463). Detect bridge / upstream-merge commits in the pushed range by subject (`grep -qiE '(bridge|merge) upstream'`) and downgrade strict->non-strict for those pushes. Warnings still surface in job output; the PR-side review already gated marker integrity for the change. Validated locally: - regex matches commit 3cc3d4c (v1.4.0 bridge merge) - analyze.ts --markers --base <prev-main> exits 0 (97 warnings shown) - --branding and --require-markers --strict both pass on main HEAD - marker-parser tests: 22/22 passing - ci.yml is valid YAML Closes #781
1 parent 3cc3d4c commit a7dea3d

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,18 @@ jobs:
441441
echo "Initial push (zero-SHA) — skipping marker check"
442442
exit 0
443443
fi
444-
echo "Push to main — running marker check against pre-push state"
445-
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict
444+
# Squash-merging an `upstream/merge-*` PR lands as a single commit
445+
# on main, so the second-parent / branch-name signal is gone here.
446+
# Detect bridge/merge-upstream commits in the pushed range by subject
447+
# and downgrade to non-strict — the PR-side review already gated this.
448+
if git log --format=%s "${{ github.event.before }}..${{ github.sha }}" \
449+
| grep -qiE '(bridge|merge) upstream'; then
450+
echo "Bridge/upstream-merge commit detected in push range — running marker check in non-strict mode"
451+
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}"
452+
else
453+
echo "Push to main — running marker check against pre-push state"
454+
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict
455+
fi
446456
elif [[ "${{ github.head_ref }}" == merge-upstream-* ]] || [[ "${{ github.head_ref }}" == upstream/merge-* ]]; then
447457
echo "Upstream merge PR detected — running marker check in non-strict mode"
448458
bun run script/upstream/analyze.ts --markers --base ${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)