ci: unblock changesets publish from npm's devEngines check - #396
Merged
Conversation
`changeset publish` shells out to `npm info` to find out what is already
on the registry. npm >= 11 validates the root package.json's devEngines
on every command, so it errors with EBADDEVENGINES ("Invalid name
\"pnpm\" does not match \"npm\"") before the release can start.
Set npm_config_force on the changesets step, which downgrades that check
to a warning. Publishing itself is unaffected: changesets detects the
pnpm lockfile and uploads through `pnpm publish`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2UZcjV4P98WFjzfRfLQvx
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P2UZcjV4P98WFjzfRfLQvx
This was referenced Aug 11, 2026
kraenhansen
added a commit
that referenced
this pull request
Aug 12, 2026
Bumps @changesets/cli to 3.0.0 (stable — the two prerelease majors this was blocked on, @changesets/cli@3.0.0 and changesets/action@v2.0.0, both shipped stable since #397 was filed) and changesets/action to v2, moving both together as required: v3 dropped the "New tag: <pkg>@<version>" stdout line action v1 parses, in favor of NDJSON `git-tag` events written to $CHANGESETS_OUTPUT that only action v2 reads. - .changeset/config.json: bump the schema pin to @changesets/config@4.0.0 (the version @changesets/cli@3.0.0 depends on). None of our config keys are affected by v4's breaking changes (no `prettier` key, baseBranch is already "main", no experimental snapshot option in use). - release.yml: rename the action's inputs to v2's kebab-case scheme (`publish:` -> `publish-script:`) and drop the `GITHUB_TOKEN` env var, since v2 reads it through a `github-token:` input that already defaults to `${{ github.token }}`. Corrects an assumption in #397: it expected this upgrade to let `npm_config_force: true` (added in #396) be removed, on the theory that v3's publish pipeline is pnpm-aware and never invokes npm. That part holds for `pnpm pack`/`pnpm publish`, verified here with strace, but `pnpm info` (which `changeset publish`/`publish-plan` use to check what's already on the registry) is itself a passthrough to the real npm CLI — `pnpm info <pkg>` execs `npm info <pkg>` — so it still trips npm's devEngines validation of this repo's root package.json. The workaround stays, with an updated comment; there's no changesets- or pnpm-version bump that removes the need for it, so the workflow comment no longer frames it as removable by this upgrade. Verified locally on Node 24 / pnpm 10.33: `changeset status`, `changeset publish-plan` (fails with EBADDEVENGINES without the env var, succeeds with it — same behavior as before), build, prettier:check, and the workspace test suite (failures are pre-existing/environmental, see below) all pass. Not verified: the actual GitHub Actions publish path (action v1 -> v2 PR description, output/input renames) only exercises the publish step once a "Version Packages" PR merges, so this needs a real run to confirm. Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the failing Release job in run 31467628286 (and the identical failure on the
Version Packages (#393)merge, run 31466790389).The failure
changeset publishshells out tonpm info <pkg> --jsonto work out which versions are already on the registry — changesets 2.x always uses npm for this, there is no pnpm code path. npm ≥ 11 validates the rootpackage.json'sdevEnginesinBaseCommand#checkDevEngines, i.e. on every command includinginfo, so it exits 1 withEBADDEVENGINESbecause we declaredevEngines.packageManager: pnpmand the process running is npm.This is why the publish only broke now: the Release job only runs the publish command once the
Version PackagesPR has been merged, and the last actual publish was on 2026-01-05. All packages on npm are currently behind the repo (react-native-node-api1.0.1 vs 1.1.0,cmake-rn0.6.3 vs 0.7.0,ferric-cli0.3.11 vs 0.4.0, …), so releases are blocked until this lands.The fix
Set
npm_config_force: trueon the changesets step. npm'scheckDevEnginesdowngradesdevEngineserrors to warnings whenforceis set, which is the only supported escape hatch —--ignore-dev-enginesis not a thing in npm 11 (it warnsUnknown cli config "--ignore-dev-engines"and still errors).Verified locally against the repo root with Node 24 / npm 11.17:
Deliberately scoped to that one step rather than the workflow (so
pnpm installabove is untouched) and rather than relaxingdevEnginesinpackage.json(which would weaken the guard for everyone locally). Publishing itself is not affected byforce: changesets detects the pnpm lockfile and uploads viapnpm publish, andpnpm publishignores the npmforceconfig.Why not upgrade changesets instead
Changesets v3 does fix the root cause properly — its publish pipeline is package-manager-aware and runs
pnpm info/pnpm pack/pnpm publishwhen pnpm is detected, so npm is never invoked. But it isn't reachable yet:@changesets/cliv3 exists only as a prerelease (next=3.0.0-next.12);latestis still 2.31.1, whose shipped dist spawns barenpm info.New tag: <pkg>@<version>stdout line thatchangesets/action@v1parses; the action's v2 line instead has the CLI write NDJSONgit-tagevents to$CHANGESETS_OUTPUTand reads that file. CLI v3 with action v1 would publish but reportpublished: falseand push no git tags or GitHub releases — a silent regression rather than a loud one.changesets/actionv2 is prerelease-only too (v2.0.0-next.4, latest stablev1.9.0) and renames every input to kebab-case, so this step would becomepublish-script:plus agithub-token:input.So that migration is two coordinated prerelease majors on the release pipeline itself, and it's worth its own PR. The workflow comment records it as the removal condition for this workaround.
Heads-up, not addressed here
NPM_TOKENwas dropped from this step in 3690bd1 ("Update release to use themainenvironment") and nothing has been published since 2026-01-05, so the auth side of the publish is untested. If npm trusted publishing is not set up for these packages, the next failure will be an auth error and the step will need eitherNPM_TOKENmapped back in from themainenvironment orpermissions: id-token: writeon the job. I left that alone since I can't see the environment's secrets or the npm-side configuration — let me know which it should be and I'll follow up.