Skip to content

Commit e3ed3bf

Browse files
ARHAEEMclaude
andcommitted
fix(ci): use explicit npm config set for token auth in publish steps
NODE_AUTH_TOKEN env-var interpolation via setup-node's NPM_CONFIG_USERCONFIG can silently fail when the root .npmrc (shamefully-hoist) causes npm to warn about unknown keys and partially skip user-config resolution. Writing the token directly with `npm config set` bypasses that path entirely. Also adds `npm whoami` diagnostic before MCP publish so failures surface a clear message rather than a cryptic 404. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fa347bf commit e3ed3bf

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,25 @@ jobs:
248248
if: |
249249
!inputs.dry_run &&
250250
(inputs.target == 'mcp-server' || inputs.target == 'both')
251-
working-directory: packages/mcp-server
252-
run: npm publish --provenance --access public
251+
run: |
252+
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
253+
npm whoami && echo "npm auth OK" || echo "WARNING: npm whoami failed — verify NPM_TOKEN secret"
254+
cd packages/mcp-server
255+
npm publish --provenance --access public
253256
env:
254-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
257+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
255258

256259
# ── Publish LSP server ─────────────────────────────────────
257260
- name: Publish LSP server to npm
258261
if: |
259262
!inputs.dry_run &&
260263
(inputs.target == 'lsp-server' || inputs.target == 'both')
261-
working-directory: packages/lsp-server
262-
run: npm publish --provenance --access public
264+
run: |
265+
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
266+
cd packages/lsp-server
267+
npm publish --provenance --access public
263268
env:
264-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
269+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
265270

266271
# ── Commit, tag, push ──────────────────────────────────────
267272
- name: Commit version bump and create tags

0 commit comments

Comments
 (0)