Repository navigation
fix: remove registry-url to restore OIDC Trusted Publisher - #33
Merged
Merged
Conversation
registry-url in setup-node generates .npmrc with empty _authToken, which interferes with npm's OIDC auto-detection, causing 404 on publish. Root cause: commit 809f5d7 accidentally re-added registry-url while adding prerelease tag support. This broke the Trusted Publisher setup from 200cd9b. Also revert the incorrect NODE_AUTH_TOKEN fix from PR #32. 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.
根因
809f5d7在添加 prerelease tag 支持时,不小心把registry-url: 'https://registry.npmjs.org'加回了setup-node。setup-node@v4配了registry-url会自动生成.npmrc:当
NODE_AUTH_TOKEN为空时(OIDC Trusted Publisher 不需要它),.npmrc中会留下一个空 token:这个空 token 干扰了 npm CLI 的 OIDC 自动检测——npm 优先读取
.npmrc中的空 token 而不是走 OIDC 流程,导致认证失败,registry 返回 404。修复
setup-node的registry-url,恢复原始 OIDC Trusted Publisher 设计(200cd9b)NODE_AUTH_TOKEN