Skip to content

ci(release): upgrade changesets/action to v2 for @changesets/cli v3 - #1995

Merged
ByronDWall merged 3 commits into
mainfrom
ci/changesets-action-v2
Sep 23, 2026
Merged

ByronDWall merged 3 commits into
mainfrom
ci/changesets-action-v2

Conversation

@misama-ct

Copy link
Copy Markdown
Collaborator

Summary

The 3.6.0 release published all five packages to npm but created no git tags
and no GitHub releases
, and the publish step still reported success. This
restores the release pipeline and recovers the missing history.

The git tags and GitHub releases for 3.6.0 have already been created manually
on d1d331e44 (the ci(changesets): version packages (#1944) commit) — a
re-run cannot recreate them, because npm already has 3.6.0, so
changeset publish reports nothing to publish and emits no entries to tag.

Root cause

@changesets/cli and changesets/action are a matched pair upstream:

Action CLI How "which packages were published" is detected
v1.x v2.x parse New tag: <pkg>@<ver> from stdout
v2.x v3.x read the file named by CHANGESETS_OUTPUT

The pair got split:

Two independent v3 breaking changes then combined:

  1. Publish detection moved off stdout (Expect publish output to be shared through a file changesets/action#678). The string
    New tag is present in @changesets/[email protected]'s dist/ and absent in
    3.0.3's. Action v1.9.0 matches it at src/run.ts:101, found zero
    packages, so the createGithubReleases block looped over an empty array —
    no pushTag, no createRelease — and set published=false. This is
    silent by construction: an empty loop cannot throw.
  2. changeset version exit code flipped (fix(version): exit with code 1 when no unreleased changesets found changesets/changesets#1860):
    return (exit 0) became throw new ExitError(1) when there are no
    unreleased changesets.

(1) un-gated the canary step (if: published != 'true'), and (2) turned it
into a hard failure against an emptied .changeset/. Under CLI v2, (1) alone
would still have lost the tags and releases while the run stayed green.

It stayed hidden for three days because neither break is reachable on a normal
push: at the #1975 merge, .changeset/ still held changesets, so
published=false was the correct answer and --snapshot found work to do.
The first real release after the upgrade is when both fired.

Upstream guards this pair in one direction only — action v2 refuses CLI v2
(changesets/action#699) — but v1 has no check rejecting CLI v3.

Changes

  • changesets/action v1.9.0 → v2.1.2. v2 reads CHANGESETS_OUTPUT, which
    it injects into the custom scripts' environment along with GITHUB_TOKEN
    (src/run.ts:176-184), so publish-script: pnpm changeset publish needs no
    change and @changesets/changelog-github still gets its token. All inputs
    were renamed in v2, so this is not a version-only bump:

    v1 v2
    publish / version publish-script / version-script
    commit / title commit-message / pr-title
    createGithubReleases create-github-releases
    commitMode: "github-api" dropped — now the default
    GITHUB_TOKEN via env github-token input (env no longer honoured)
  • Guarded both canary steps on the presence of changeset files, so an empty
    .changeset/ is a clean skip instead of exit 1.

  • Added a tagging assertion. If the version on npm has no matching git tag,
    the job now fails with an actionable message instead of reporting success.
    Verified locally against all paths, including that it would have caught this
    incident and that its ls-remote pattern does not match sibling packages.

  • Removed scripts/print_release_version.sh and its step. Its output
    (steps.release_version.outputs.VALUE) is read nowhere in the workflow, its
    exit code was swallowed by echo "VALUE=$(...)", and it ran
    changeset version followed by git reset --hard inside the release job.

Side benefit

Renovate said "if you manually upgrade to 2.x then Renovate will re-enable
minor and patch updates automatically."
Landing v2.1.2 by hand lifts the
suppression left by #1931.

Verification

  • Workflow YAML parses; step list unchanged apart from the removal and the new
    assertion.
  • Guard logic exercised locally: positive (npm + tag present), missing tag,
    version absent from npm (skip), and no cross-package false match.
  • The publish path itself only executes on a real release, so the true end-to-end
    proof is the next version PR merge. Worth watching that run.

No changeset needed — CI configuration only, no published package changed.

@changesets/cli v3 no longer prints the "New tag: <pkg>@<version>" lines that
changesets/action v1.9.0 scraped to learn which packages were published. The
action therefore saw zero published packages: it pushed no git tags, created no
GitHub releases, and set published=false -- while npm publishing itself
succeeded. 3.6.0 reached npm with no GitHub release history because of this,
and the publish step still reported success.

Two v3 breaking changes combined to produce the failed run:

- Published-package detection moved from stdout parsing to a shared output file
  named by CHANGESETS_OUTPUT (changesets/action#678). Action v1 has no such
  support and reported published=false, which skipped tagging and releases and
  also un-gated the canary step below.
- `changeset version` now exits 1 when there are no unreleased changesets
  (changesets/changesets#1860); v2 exited 0 silently. That turned the
  un-gated canary step into a hard job failure.

Upstream treats these as a matched pair and action v2 validates it, refusing
CLI v2 (changesets/action#699). There is no equivalent check in v1 for CLI v3,
which is why the mismatch degraded silently instead of failing fast.

Changes:

- changesets/action v1.9.0 -> v2.1.2, using v2's renamed kebab-case inputs and
  passing the app token through the `github-token` input, which is now required
  for custom tokens. `commitMode: github-api` is dropped because v2 uses the
  GitHub API by default.
- Guard both canary steps on the presence of changeset files, so an emptied
  .changeset/ is a clean skip rather than exit 1.
- Add a step asserting that the version present on npm has a matching git tag,
  so a silent tagging failure fails the job instead of reporting success.
- Remove scripts/print_release_version.sh and its step. Its output was read
  nowhere in the workflow, its exit code was swallowed by the surrounding
  command substitution, and it ran `changeset version` followed by
  `git reset --hard` inside the release job.

Co-Authored-By: Claude Opus 5 <[email protected]>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 715ef51

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@misama-ct
misama-ct requested a review from a team as a code owner September 18, 2026 09:13
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nimbus-documentation Ready Ready Preview Sep 23, 2026 7:31am UTC
nimbus-storybook Ready Ready Preview Sep 23, 2026 7:31am UTC

Request Review

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Report

Last updated: 2026-09-23 07:29:15 UTC

Package Format Current Baseline Delta Status
@commercetools/nimbus dist 20220.2 KB 20220.4 KB -0.0% ✅ ok
@commercetools/nimbus-icons dist 4787.6 KB 4787.6 KB +0.0% ✅ ok
@commercetools/nimbus-tokens dist 408.9 KB 408.9 KB +0.0% ✅ ok

Baseline source: comment-chain

The explanatory blocks restated the commit message and PR description, which
git blame already reaches, and ran six to eight lines in a file whose idiom is
one- to three-line constraint notes. Keep only what is not visible in the code
and would be re-broken if removed: that the action and CLI majors move
together, that the tag check is deliberately independent of the action's own
report, and why the canary steps test for changeset files before versioning.

Co-Authored-By: Claude Opus 5 <[email protected]>

@ByronDWall ByronDWall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good lookin out my sir

@ByronDWall
ByronDWall merged commit 78b1ac9 into main Sep 23, 2026
10 checks passed
@ByronDWall
ByronDWall deleted the ci/changesets-action-v2 branch September 23, 2026 13:12
@github-actions github-actions Bot added the bundle-sizes Housekeeping for merged PRs - allows the fetch sizes script to find the latest bundle check comment. label Sep 23, 2026

This branch was successfully deployed

2 active deployments
Preview – nimbus-storybook — 715ef510 Deployed Sep 23, 2026 by vercel[bot]
Preview – nimbus-documentation — 715ef510 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working bundle-sizes Housekeeping for merged PRs - allows the fetch sizes script to find the latest bundle check comment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants