Skip to content

Commit eeb4012

Browse files
committed
fix(scripts): refuse a PR that modifies or deletes a changeset it did not add (#17712)
A changeset filename is content-free, so a collision looks like nothing: the changesets default word-pair names were designed for one human running the CLI at a time, and this repository runs many agents in parallel drawing from the same small name space. Overwriting somebody else's changeset produces a perfectly valid changeset file, so every parse-shaped gate stays green on both sides -- the sibling PR's release note is silently replaced, its own CI never re-runs, and the loss surfaces at release time in the generated CHANGELOG with the authoring PR long merged. check-empty-changeset.mjs now answers a second question in the same run: a `.changeset/*.md` that exists on the merge base and was not added by this PR may be neither modified nor deleted. "Added by this PR" is the file's absence on the merge base, which is what git's status letters already say, so the rule is content-blind and legacy names are untouched. Rename detection is off for this pass (the opposite of rule 1's `AMR`): renaming somebody else's changeset deletes their release note at its path, and with detection on that deletion is folded into an `R` row and disappears. Wired into check-empty-changeset.mjs rather than a new script so it inherits the `changeset-check` job's merge base, its `changeset-release/main` exemption -- `changeset version` deletes every changeset, so the release PR would be structurally unsatisfiable otherwise -- and its self-test's place in lint.yml, with no workflow diff at all. Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU Co-authored-by: Claude <noreply@anthropic.com>
1 parent a90a9f2 commit eeb4012

1 file changed

Lines changed: 469 additions & 6 deletions

File tree

0 commit comments

Comments
 (0)