Skip to content

Commit 0bffdae

Browse files
os-project-manageros-devclaude
authored
fix(ci): diff-scope the no-major changeset guard against the merge base (#7005) (#7048)
`check-changeset-no-major.mjs` read the whole `.changeset` directory with no branch point, so its verdict was a function of what main carried rather than of what the author wrote. Dormant while pre-mode holds; at `changeset pre exit` it would have failed every unlabelled PR in the repo, each listing 172 pending major changesets it never touched, with `allow-major` as the only route out. Judge only what the diff introduces, starting at `merge-base(base, head)` — the machinery `check-empty-changeset.mjs` already carries for #6129, reused rather than reinvented. The pending stock is exempt with no roster. Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn Co-authored-by: os-dev <dev@objectstack.ai> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 17a0a1e commit 0bffdae

2 files changed

Lines changed: 751 additions & 124 deletions

File tree

.github/workflows/pr-automation.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,21 @@ jobs:
822822
# never the event payload. Its comment block carries the argument: what the
823823
# payload read cost, where this diverges from #5580's `skip-changeset` read
824824
# and why, the residual it leaves, and what re-arms the whole thing.
825+
#
826+
# `--base` takes the same merge base the two gates above take, for the
827+
# same #6129 reason one defect along (#7005). This script used to read
828+
# the whole `.changeset` directory with no branch point, so its verdict
829+
# was a function of what main carried rather than of what the author
830+
# wrote. That was invisible while pre-mode held and would have become
831+
# visible all at once at `changeset pre exit`: 171 consumed-but-undeleted
832+
# major changesets sit on main until the post-exit `changeset version`
833+
# removes them, so every unlabelled PR open in that window would have
834+
# gone red listing files it never touched, with `allow-major` -- a label
835+
# meaning "a whole-stack major is intended HERE" -- as its only way out.
825836
if: >-
826837
steps.labels.outputs.skip != 'true'
827838
&& steps.labels_settled.outputs.skip != 'true'
828839
&& steps.allow_major.outputs.allow != 'true'
829-
run: node scripts/check-changeset-no-major.mjs
840+
env:
841+
MERGE_BASE: ${{ steps.diffbase.outputs.merge_base }}
842+
run: node scripts/check-changeset-no-major.mjs --base "$MERGE_BASE"

0 commit comments

Comments
 (0)