Skip to content

Pin changesets/action and migrate to v2 - #2451

Merged
spaceninja merged 1 commit into
mainfrom
chore/pin-changesets-action
Aug 26, 2026
Merged

Pin changesets/action and migrate to v2#2451
spaceninja merged 1 commit into
mainfrom
chore/pin-changesets-action

Conversation

@spaceninja

Copy link
Copy Markdown
Member

Overview

changesets.yml was still tracking changesets/action@master, the last floating action ref in this repo. It turned out to be a worse problem than "unpinned": that repository's default branch is main, and master was last committed to in November 2021 — while the action has shipped v2.0.0, v2.1.0 and v2.1.1 in the past two weeks. The ref wasn't drifting with upstream, it was frozen on a four-year-old build with nothing to signal that development had moved elsewhere. Renovate can see the entry but can't propose an upgrade from a branch ref, which is why it never surfaced.

That means the pin can't be done on its own. v2 renames every input this workflow used, and changes how both tokens are supplied. Since this is the workflow that publishes to npm, the details are below — the failure modes here are quiet ones.

Found while auditing floating action refs across the org: of 137 non-archived repos, three had one. This and lighthouse-parade were two of them; the third belongs to another maintainer and was left alone.

Screenshots

Testing

There's no way to exercise this without an actual release, so the useful review is reading rather than running. These are the things to check when it does run.

  • Read the diff against the v2 API table and confirm all four renamed inputs match: publish-script, version-script, pr-title, commit-message.
  • After merging, watch the first Release run on main. It should update the existing "Publish Next Version" pull request rather than opening a second one — pr-title is unchanged, so it should match.
  • On the next actual publish, confirm the npm step authenticates. This is the change most likely to fail: v2 stopped writing an .npmrc from NPM_TOKEN, so auth now comes from setup-node's registry-url plus NODE_AUTH_TOKEN. A failure looks like ENEEDAUTH or a 401 from the registry, not a workflow syntax error.
  • Confirm the release commit and tag land on main as usual. v2 pushes them via the GitHub API rather than the Git CLI by default, so they'll be signed by GitHub and attributed to the token owner — expect the commit author to look different from previous releases.

Notes for the reviewer

Three breaking changes needed handling beyond the renames:

  1. GITHUB_TOKEN env var is ignored in v2. The github-token input now has to be explicit — but it defaults to the GitHub-provided token, which is exactly what this was passing. So it's dropped rather than converted.
  2. NPM_TOKEN env var no longer configures npm. v2 removed its .npmrc handling and directs you to setup-node's registry-url with NODE_AUTH_TOKEN. The repository secret is unchanged; only the variable name it binds to differs.
  3. permissions is now required. v2's docs call for contents: write and pull-requests: write. Declaring them explicitly also drops every other permission the default token would carry.

v2 requires Changesets v3. This repo is on @changesets/cli 3.0.1, so that's satisfied — worth confirming, since the v1 line is what pairs with Changesets v2.

Also lifted the pinned Node version into an env block to match what ci.yml in this repo already does. No behavior change.

The equivalent change for lighthouse-parade is in cloudfour/lighthouse-parade#389.

changesets/action@master is worse than unpinned. That repo's default
branch is `main`; `master` was last touched in November 2021, while the
action has since shipped through v2.1.1 this month. The ref wasn't
drifting, it was frozen on a four-year-old build with nothing to signal
that development had moved elsewhere.
v2 renames every input this workflow used, so the pin can't be done
alone:
publish -> publish-script title -> pr-title
version -> version-script commit -> commit-message
Two further breaking changes needed handling. v2 no longer reads a token
from the GITHUB_TOKEN environment variable; the `github-token` input
defaults to the GitHub-provided token, which is what this used, so it is
dropped. And v2 no longer writes an .npmrc from NPM_TOKEN —
authentication moves to setup-node's registry-url plus NODE_AUTH_TOKEN.
Without that, publishing would fail on credentials.
v2 requires Changesets v3; this repo is on @changesets/cli 3.0.1.
Also lifts the pinned Node version into an env var, matching ci.yml.
@netlify

netlifyBot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for cloudfour-patterns ready!

NameLink
🔨 Latest commitafc5a63
🔍 Latest deploy loghttps://app.netlify.com/projects/cloudfour-patterns/deploys/6a8e2d21747c28000866dbc5
😎 Deploy Previewhttps://deploy-preview-2451--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: afc5a63

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

@spaceninja
spaceninja merged commit 0e73e58 into mainAug 26, 2026
8 checks passed
@spaceninja
spaceninja deleted the chore/pin-changesets-action branch August 26, 2026 00:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@spaceninja