Skip to content

Commit d27340c

Browse files
Codex Agentclaude
andcommitted
fix: restore NPM_TOKEN auth — provenance is attestation, not authentication
npm --provenance signs a build attestation but does NOT replace token auth (unlike PyPI trusted publishing). Still need NPM_TOKEN secret. Keep --provenance for supply chain security, restore NODE_AUTH_TOKEN. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7a7ac16 commit d27340c

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,13 @@ jobs:
285285
npm pack --dry-run -w @debugmcp/adapter-python
286286
npm pack --dry-run -w @debugmcp/mcp-debugger
287287
288-
- name: Publish to npm (workspaces, trusted publishing)
288+
- name: Publish to npm (workspaces)
289289
run: |
290+
# Authenticate npm
291+
npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
292+
290293
# Publish packages in dependency order if the target version does NOT yet exist
291-
# Uses OIDC provenance via --provenance — no long-lived NPM_TOKEN needed
294+
# --provenance adds signed build attestation (requires id-token: write)
292295
if npm view @debugmcp/shared@${SHARED_VERSION} version >/dev/null 2>&1; then
293296
echo "@debugmcp/shared@${SHARED_VERSION} already exists, skipping"
294297
else
@@ -312,6 +315,8 @@ jobs:
312315
else
313316
npm publish -w @debugmcp/mcp-debugger --access public --provenance --tag ${NPM_TAG}
314317
fi
318+
env:
319+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
315320

316321
create-release:
317322
name: Create GitHub Release

‎.github/workflows/validate-secrets.yml‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@ on:
55

66
jobs:
77
validate-npm:
8-
name: "npm: trusted publishing"
8+
name: "npm: token"
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Check package linkage
11+
- name: Test token
12+
env:
13+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1214
run: |
13-
FAILED=false
14-
for pkg in @debugmcp/shared @debugmcp/adapter-mock @debugmcp/adapter-python @debugmcp/mcp-debugger; do
15-
REPO=$(npm view "$pkg" repository.url 2>/dev/null || echo "")
16-
if echo "$REPO" | grep -q "debugmcp/mcp-debugger"; then
17-
echo "✅ $pkg linked to debugmcp/mcp-debugger"
18-
elif [[ -z "$REPO" ]]; then
19-
echo "⚠️ $pkg not found on npm (OK if first publish)"
20-
else
21-
echo "❌ $pkg repository: $REPO — expected debugmcp/mcp-debugger"
22-
FAILED=true
23-
fi
24-
done
25-
if [[ "$FAILED" == "true" ]]; then exit 1; fi
15+
npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
16+
NPM_USER=$(npm whoami --registry https://registry.npmjs.org 2>&1) || true
17+
if [[ -n "$NPM_USER" && "$NPM_USER" != *"error"* && "$NPM_USER" != *"ERR"* ]]; then
18+
echo "✅ NPM_TOKEN is valid (user: $NPM_USER)"
19+
else
20+
echo "❌ NPM_TOKEN is invalid or expired"
21+
echo " Response: $NPM_USER"
22+
echo " Fix: create a Classic Automation token at npmjs.com → Access Tokens"
23+
exit 1
24+
fi
2625
2726
validate-docker:
2827
name: "Docker Hub: credentials"

0 commit comments

Comments
 (0)