fix(ci): stop release from republishing already-released packages - #597
Merged
Conversation
npm@latest is now 12, which makes npm info --json return an array. @changesets/cli before 2.31 reads .versions off the top-level object, sees none, and treats every package as unpublished — so Release tries to republish already-live versions and fails (while streamdown/remend do publish). Also drop setup-node registry-url so OIDC runs do not poison anonymous npm info reads with an empty NODE_AUTH_TOKEN auth line.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
After a release where packages already published, Deploy is skipped because published!=true. Add workflow_dispatch with a deploy input (default true) so ops can re-run Release and ship the site without a fake version bump.
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.
Summary
The Release workflow on
Version Packages (#580)failed after successfully publishingstreamdown@2.6.0andremend@1.3.1, because it also tried to re-publish plugin packages that were already on npm:Root cause:
npm install -g npm@latestnow installs npm 12, which changednpm info <pkg> --jsonto return a JSON array.@changesets/cli@2.30reads.versionsoff the top-level object, getsundefined, treats every package as unpublished, and re-attempts publish. Failed republishes exit 1 → red Release even though the new packages did publish.Secondary hazard:
actions/setup-noderegistry-urlwrites//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}into the runner npmrc. Under OIDC trusted publishing there is noNODE_AUTH_TOKEN, so anonymousnpm inforeads can be poisoned (empty stdout → synthetic E404 → same false-unpublished path).Fix
@changesets/clito^2.31.1(parses npm 12's array shape).npm@11(≥11.5.1 for trusted publishing; keeps the object-shapednpm info --json).registry-urlfromsetup-nodeso OIDC runs don't inject a broken auth line.No package code / version bumps — CI-only. Next push to
mainwith no open changesets should report "No unpublished projects to publish" and go green.Test plan
@streamdown/*republish