fix: use corepack to upgrade npm for OIDC publishing#28
Merged
Conversation
… npm Node 22.22.2's GitHub Actions toolcache ships a broken npm 10.9.7 whose arborist fails to load (missing promise-retry), so the release job's `npm install -g npm@latest` self-upgrade aborts with MODULE_NOT_FOUND. Run the global install via a healthy npm fetched by corepack, which gets npm 11.x onto PATH for OIDC trusted publishing. https://claude.ai/code/session_01QnqHcaFmaudSvse6GSEY5Q
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🎉 This PR is included in version 1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Updates the npm upgrade step in the release workflow to use corepack instead of directly calling
npm install -g npm@latest. This works around a bug in Node 22.22.2's bundled npm 10.9.7, which has a broken arborist that fails to load due to a missingpromise-retrydependency.By routing the global npm install through corepack (which fetches a healthy npm version), we avoid the MODULE_NOT_FOUND error that would otherwise abort the self-upgrade process.
Fixes nodejs/node#62425 and npm/cli#9151.
Test plan
N/A - This is a CI workflow configuration fix. The change will be validated when the release workflow runs.
Release
Notes for reviewers
The change is minimal and surgical—only the npm upgrade command is modified to use corepack as an intermediary. This ensures the release workflow can successfully upgrade npm to 11.5.1+ for OIDC trusted publishing, even when running on Node 22.22.2.
https://claude.ai/code/session_01QnqHcaFmaudSvse6GSEY5Q