Skip to content

Commit cae7fb4

Browse files
Diagnose npm auth (#229)
* Add npm authentication diagnostics to publish workflow * Improve npm authentication diagnostics with more detailed output
1 parent 6bec851 commit cae7fb4

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,42 @@ jobs:
2929
cache: pnpm
3030
- name: Install dependencies
3131
run: pnpm install --frozen-lockfile
32+
- name: Diagnose npm authentication
33+
run: |
34+
echo "=== NPM Authentication Diagnostics ==="
35+
echo "Node version: $(node --version)"
36+
echo "npm version: $(npm --version)"
37+
echo "pnpm version: $(pnpm --version)"
38+
echo ""
39+
echo "=== Environment Variables ==="
40+
echo "NPM_TOKEN set: ${NPM_TOKEN:+yes (length ${#NPM_TOKEN})}"
41+
echo "NODE_AUTH_TOKEN set: ${NODE_AUTH_TOKEN:+yes (length ${#NODE_AUTH_TOKEN})}"
42+
echo "NPM_CONFIG_USERCONFIG: $NPM_CONFIG_USERCONFIG"
43+
echo ""
44+
echo "=== npm config ==="
45+
npm config list --json | jq '.registry, .["@openrouter:registry"], .["@openrouter/registry"]' || npm config list
46+
echo ""
47+
echo "=== .npmrc files ==="
48+
for rc in ~/.npmrc "$NPM_CONFIG_USERCONFIG" .npmrc; do
49+
if [ -f "$rc" ]; then
50+
echo "Found: $rc"
51+
wc -l "$rc"
52+
fi
53+
done
54+
echo ""
55+
echo "=== Auth token in registry ==="
56+
npm config get //registry.npmjs.org/:_authToken | head -c 10 && echo "***[rest redacted]"
57+
echo ""
58+
echo "=== npm whoami ==="
59+
npm whoami 2>&1 || echo "FAILED"
60+
echo ""
61+
echo "=== npm ping ==="
62+
npm ping 2>&1 || echo "FAILED"
63+
echo ""
64+
echo "=== Verify package exists on npm ==="
65+
npm view @openrouter/ai-sdk-provider@latest version 2>&1 || echo "FAILED"
66+
env:
67+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3268
- name: Create Release Pull Request or Publish
3369
uses: changesets/action@v1
3470
with:

0 commit comments

Comments
 (0)