fix(ci): set NODE_AUTH_TOKEN for npm publish to fix E404 error - #3924
Draft
rzp-slash-public[bot] wants to merge 1 commit into
Draft
fix(ci): set NODE_AUTH_TOKEN for npm publish to fix E404 error#3924rzp-slash-public[bot] wants to merge 1 commit into
rzp-slash-public[bot] wants to merge 1 commit into
Conversation
Co-authored-by: admin <admin>
|
Contributor
|
🤖 Slash AI Review has been triggered. View execution logs |
Collaborator
🛡️ Coverage ReportSummaryFull Coverage Details |
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.
Problem
The Blade Release workflow (run #32966842679) failed at the Publish to public npm registry step with:
Root Cause
In
.github/workflows/release.yml, theNPM_TOKENenv var was commented out:# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}The publish script (
scripts/publishToNpm.js) only writes the auth token to.npmrcwhenNODE_AUTH_TOKENis set. Without it,npm publishruns unauthenticated, resulting in a 404 error (npm returns 404 instead of 401/403 to avoid leaking package existence info).The script's own comment documents this: "without the token, npm returns E404" for packages where OIDC trust hasn't been established yet.
Fix
Set
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}in the env block of the "Publish to public npm registry" step, replacing the commented-outNPM_TOKENline. This provides the authentication token that the publish script expects as a fallback when OIDC trusted publishing is not yet configured for the package on npmjs.com.Automated changes by autonomous agent.
Requested by: admin