Skip to content

fix(release): pass the npm token through a temp userconfig - #2

Merged
DoodleBears merged 1 commit into
mainfrom
claude/release-auth
Oct 5, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
claude/release-auth

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

Before: the release workflow failed with 404 Not Found on the first package, even with a valid read-and-write token in NPM_TOKEN.

After: the token reaches npm and the release can publish.

pnpm 11+ no longer reads npm_config_* auth variables, so release.mjs was publishing with no credentials at all. Against a local stub registry, the old way sent no Authorization header; the new way sends Bearer <token>.

How. After build and verify, release.mjs writes //registry.npmjs.org/:_authToken=… to a mode-600 npmrc in a temp dir, points the publish processes at it with NPM_CONFIG_USERCONFIG, and deletes the dir when publishing ends, even if it fails. The token still never appears on a command line. BotUI's release.mjs uses the same env-var approach and will hit the same problem with pnpm 12.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GykcoiqQvD2ZC8e5VwyMYp


Generated by Claude Code

pnpm 11+ ignores npm_config_* auth variables, so the release workflow published
without credentials and npm answered 404. Write the token to a mode-600 npmrc in
a temp dir, name it with NPM_CONFIG_USERCONFIG, and remove it afterwards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GykcoiqQvD2ZC8e5VwyMYp
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 341b5761-94ad-4587-a134-687edf67a564
📥 Commits

Reviewing files that changed from the base of the PR and between 1502914 and 5f3ad44.

📒 Files selected for processing (1)
  • scripts/release.mjs
 ________________________________________
< Even Chuck Norris needs a code review. >
 ----------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears merged commit 15697d8 into main Oct 5, 2026
1 of 2 checks passed
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.

2 participants