Skip to content

Commit e6cb82b

Browse files
committed
fix(ci): Check Changeset stops prescribing the empty changeset that stalled the release (#5292)
The gate's failure message offered "an empty changeset" and the `skip-changeset` label as two equal ways out, and the comment above the counter called them "on par". They are equal to THIS gate's counting, but not downstream: the label is a gate-level exemption that produces no input for changesets/action, while an empty-frontmatter changeset is a real input to it. When every pending changeset is empty the action takes its `hasChangesets && !hasNonEmptyChangesets` branch, prints "All changesets are empty; not creating PR" and returns in 0 seconds -- no version PR, no publish, Release run green. That is #4898, which stalled 17.0.0-rc.2. The message was therefore an active mis-prescription: it handed a known release-stalling input to whoever had just hit the wall. Rewritten to three ranked routes, with the label preferred and the empty changeset demoted to a warned last resort that names #4898. The counting logic is untouched: an empty changeset still counts, so today's precedent (#5453 / #5454, both merged behind empty changesets) stays valid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GX3sL71LFq8m2usg6VqTSE
1 parent 61fde5e commit e6cb82b

1 file changed

Lines changed: 46 additions & 4 deletions

File tree

.github/workflows/pr-automation.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,55 @@ jobs:
9999
# never go red. #3373 merged a real spec/api-surface fix with no
100100
# changeset while this step happily reported "Found 104 changeset(s)".
101101
# Diffing against BASE_SHA ignores that residue and sees only what the
102-
# PR itself introduced. An empty-frontmatter changeset still counts —
103-
# it is the sanctioned "this PR releases nothing" declaration, on par
104-
# with the skip-changeset label.
102+
# PR itself introduced.
103+
#
104+
# An empty-frontmatter changeset still COUNTS here, and that is
105+
# deliberate and unchanged — it remains a legal "this PR releases
106+
# nothing" declaration. What #5292 corrected is the PRESCRIPTION, not
107+
# the count: this comment used to call it "on par with the
108+
# skip-changeset label", and the failure message below used to offer
109+
# the two as equals. They are not equal downstream. The label is a
110+
# gate-level exemption that produces no input for changesets/action;
111+
# an empty changeset is a real input to it. See the message for the
112+
# consequence.
105113
ADDED=$(git diff --name-only --diff-filter=A "$BASE_SHA" HEAD -- '.changeset/*.md' \
106114
| grep -v '/README\.md$' | wc -l | tr -d '[:space:]')
107115
if [ "$ADDED" -eq 0 ]; then
108-
echo "::error::This PR adds no changeset. Run 'pnpm changeset' (an empty changeset is fine for changes that release nothing), or apply the 'skip-changeset' label if it does not need one."
116+
# The full comparison goes to the job log — that is what an author
117+
# reading `gh run view --log-failed`, or expanding this step in the
118+
# UI, actually sees. The ::error:: annotation after it is the
119+
# one-line version for the Checks tab. Both lead with the label.
120+
# Terminator sits at this block's base indentation on purpose: YAML
121+
# strips that much from every line, so `MSG` lands in column 0 of
122+
# the generated script. Do not re-indent it.
123+
cat <<'MSG'
124+
This PR adds no changeset. There are three ways forward, and they are NOT
125+
equivalent. Pick by what the PR actually releases:
126+
127+
1. It releases something
128+
-> run 'pnpm changeset' and name the packages it releases.
129+
130+
2. It releases nothing (.github/, .claude/, docs/, content/, examples/,
131+
tests-only, and the like)
132+
-> apply the 'skip-changeset' label. <<< PREFERRED
133+
The label is a gate-level exemption. It produces NO input for
134+
changesets/action, so it cannot affect a release.
135+
136+
3. An empty-frontmatter changeset also satisfies this gate and stays
137+
legal -- but it is a LAST RESORT, not the quick way past a red check.
138+
Unlike the label it is a REAL INPUT to changesets/action: when every
139+
pending changeset is empty, the action takes its
140+
"hasChangesets && !hasNonEmptyChangesets" branch, prints
141+
"All changesets are empty; not creating PR", and returns in 0 seconds
142+
-- no version PR, no publish, and the Release run still goes GREEN.
143+
That is #4898, which silently stalled 17.0.0-rc.2. It also buys you
144+
nothing the label does not: an empty changeset names no package, so
145+
its body reaches no CHANGELOG.
146+
147+
If you are unsure, take route 2. A wrong 'skip-changeset' label is caught by
148+
review; a wrong empty changeset is caught by nobody.
149+
MSG
150+
echo "::error::This PR adds no changeset. If it releases nothing, apply the 'skip-changeset' label (preferred); otherwise run 'pnpm changeset' and name the packages. An empty-frontmatter changeset also passes this gate, but it is NOT equivalent to the label -- it is a real input to changesets/action, and an all-empty set stalls the release silently and greenly (#4898). Full comparison in this step's log."
109151
exit 1
110152
fi
111153
echo "This PR adds $ADDED changeset(s)."

0 commit comments

Comments
 (0)