Repository navigation
Commit 2871626
ci(npm-dist-tag): setup-node's registry-url shadowed the npmrc the step writes
The workflow added yesterday failed its first real run with `E401 — Unable to
authenticate, your authentication token seems to be invalid` on all fourteen packages,
which reads as a dead `NPM_TOKEN` secret. It is not.
`actions/setup-node` with `registry-url:` writes its own `.npmrc` and exports
`NPM_CONFIG_USERCONFIG` pointing at it. That config wins over `~/.npmrc`, so the
`~/.npmrc` the step writes from the secret is never read; npm authenticated with
setup-node's un-expanded `${NODE_AUTH_TOKEN}` placeholder instead, and the registry
rejected it. The run log shows both values side by side.
The failure mode is worth naming because it inverts the diagnosis: an E401 here says
"npm read a config you did not write", not "the secret is expired". Chasing the secret
would have replaced a working credential and left the workflow broken.
Fixed by dropping `registry-url:`, so this authenticates exactly the way
`publish-npm.yml` does — one mechanism for both npm paths, which is what makes the
workflow's own premise true: the token that publishes the set is the token that retags
it. `publish-npm.yml` was never affected; it uses `setup-bun`, and `bun publish` reads
`~/.npmrc`.
Also fails on the credential once, up front, instead of fourteen identical per-package
errors that look like a registry-side refusal of the operation itself.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTcEKXTQMYt84fAjuw5A2M1 parent abddef7 commit 2871626
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | | - | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
0 commit comments