Repository navigation
fix: use corepack to update npm for OIDC support - #34
Merged
Merged
Conversation
Restore registry-url (required for OIDC token exchange) and replace the broken 'npm install -g npm@latest' with corepack to upgrade npm. npm@latest has a MODULE_NOT_FOUND bug (missing promise-retry) as of 2026-04-28. corepack bypasses the corrupted npm binary to install a clean version. npm 11+ is required for proper OIDC auto-detection in GitHub Actions. Co-Authored-By: Claude Sonnet 4.5 <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.
问题
今天 npm@latest 出了 bug(
MODULE_NOT_FOUND: promise-retry),导致之前一直能用的npm install -g npm@latest步骤失败。PR #30 删除了这个步骤,但 Node 22 自带的 npm 10.x 对 OIDC 支持不完整——provenance 能签名成功,但npm publish的 PUT 请求认证会失败返回 404。随后的 PR #33 误判为
registry-url的问题将其移除,导致 OIDC 完全没触发(ENEEDAUTH)。修复
registry-url— OIDC token 交换需要它来知道目标 registrycorepack替代npm install -g升级 npm — 绕过 npm@latest 的promise-retrybugcorepack直接从 registry 下载 npm 包,不依赖本地 npm 是否损坏。