Skip to content

fix(ci): stop release from republishing already-released packages - #597

Merged
farnabaz merged 2 commits into
mainfrom
fix/release-ci-false-republish
Aug 24, 2026
Merged

fix(ci): stop release from republishing already-released packages#597
farnabaz merged 2 commits into
mainfrom
fix/release-ci-false-republish

Conversation

@farnabaz

Copy link
Copy Markdown
Collaborator

Summary

The Release workflow on Version Packages (#580) failed after successfully publishing streamdown@2.6.0 and remend@1.3.1, because it also tried to re-publish plugin packages that were already on npm:

You cannot publish over the previously published versions: 1.0.3  (@streamdown/cjk)
You cannot publish over the previously published versions: 1.1.1  (@streamdown/code)
You cannot publish over the previously published versions: 1.0.2  (@streamdown/math)
You cannot publish over the previously published versions: 1.0.2  (@streamdown/mermaid)

Root cause: npm install -g npm@latest now installs npm 12, which changed npm info <pkg> --json to return a JSON array. @changesets/cli@2.30 reads .versions off the top-level object, gets undefined, 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-node registry-url writes //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} into the runner npmrc. Under OIDC trusted publishing there is no NODE_AUTH_TOKEN, so anonymous npm info reads can be poisoned (empty stdout → synthetic E404 → same false-unpublished path).

Fix

  1. Bump @changesets/cli to ^2.31.1 (parses npm 12's array shape).
  2. Pin the Release npm install to npm@11 (≥11.5.1 for trusted publishing; keeps the object-shaped npm info --json).
  3. Drop registry-url from setup-node so OIDC runs don't inject a broken auth line.

No package code / version bumps — CI-only. Next push to main with no open changesets should report "No unpublished projects to publish" and go green.

Test plan

  • CI green on this PR
  • After merge: Release on main succeeds without attempting @streamdown/* republish
  • Future real version bumps still publish via OIDC trusted publishing

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.
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
streamdown Ready Ready Preview, v0 Aug 24, 2026 4:56pm

@socket-security

socket-security Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​changesets/​cli@​2.31.19710010097100

View full report

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.
@farnabaz
farnabaz merged commit bcea60b into main Aug 24, 2026
10 checks passed
@farnabaz
farnabaz deleted the fix/release-ci-false-republish branch August 24, 2026 17:00
Sign up for free to 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