Skip to content

Commit 41aebcf

Browse files
fix(ci): strip _authToken line so OIDC trusted publishing engages
#1016's npm-upgrade alone didn't fix the E404 — the runner already had npm 11.6 (>= 11.5.1). Real cause (actions/setup-node#1551): setup-node with registry-url writes //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} to .npmrc; with no NODE_AUTH_TOKEN, npm sees a placeholder auth line, assumes token auth, and never runs the OIDC token exchange -> unauthenticated PUT -> E404. Strip the _authToken line before publish so npm detects ACTIONS_ID_TOKEN_REQUEST_* and runs the OIDC exchange against the configured Trusted Publisher. Signed-off-by: Vinayak Kulkarni <[email protected]>
1 parent 2c2a010 commit 41aebcf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎.github/workflows/release-please.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ jobs:
6464
env:
6565
NODE_OPTIONS: --max-old-space-size=8192
6666

67+
# actions/setup-node writes `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}`
68+
# to .npmrc. With no NODE_AUTH_TOKEN, npm sees a placeholder auth line, assumes
69+
# token auth, and never runs the OIDC token exchange -> E404. Strip it so the
70+
# Trusted Publisher (OIDC) flow engages. See actions/setup-node#1551.
71+
- name: Strip _authToken line for OIDC trusted publishing
72+
run: sed -i '/_authToken/d' "${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
73+
6774
- name: Publish to npm with provenance
6875
working-directory: packages/v-mapkit
6976
run: npm publish --provenance --access public --ignore-scripts

0 commit comments

Comments
 (0)