Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

ci: switch npm publish to OIDC trusted publishing - #10

Draft
mcp-tool-shop wants to merge 1 commit into
mainfrom
ci/oidc-trusted-publishing
Draft

ci: switch npm publish to OIDC trusted publishing#10
mcp-tool-shop wants to merge 1 commit into
mainfrom
ci/oidc-trusted-publishing

Conversation

@mcp-tool-shop

Copy link
Copy Markdown
Member

Switch npm publish to OIDC Trusted Publishing

Why this PR exists. This repo's release.yml authenticates npm publish with a NODE_AUTH_TOKEN wired to the NPM_TOKEN repo secret. That model just failed in production: on 2026-06-02, @mcptoolshop/backprop-trace v0.12.0 failed to release with an npm E404 on the registry PUT. Root cause - the NPM_TOKEN secret had expired, and npm masks an expired/under-privileged token as a 404 (not a 403), which hid the real cause. Every repo still on this token pattern will hit the identical failure when its token expires.

The fix (identical to the already-proven backprop-trace migration):

  • Remove the NODE_AUTH_TOKEN env (wired to the NPM_TOKEN secret) from the publish step.
  • Add a step npm install -g npm@latest immediately before publish - OIDC trusted publishing requires npm >= 11.5.1, and Node 22 bundles npm 10.9.x.
  • Keep id-token: write on the publish job.
  • Keep npm publish --provenance --access public.

Proof it works. @mcptoolshop/backprop-trace@0.12.0 is live on npm, published with _npmUser.name: "GitHub Actions" + a trustedPublisher block and a SLSA provenance attestation - exactly the end state this PR produces.


⚠️ BLOCKING PREREQUISITE - configure this on npmjs.com BEFORE merging

This PR is intentionally a draft. The code change is inert until a Trusted Publisher exists for the package, and merging without it will make the next release fail (no token, and no trusted publisher to fall back on).

  1. On npmjs.com -> package @mcptoolshop/ai-loadout -> Settings -> Trusted Publishers -> add a GitHub Actions publisher:
    • Owner/organization: mcp-tool-shop-org
    • Repository: ai-loadout
    • Workflow filename: release.yml
    • Environment: (leave blank)
  2. Mark this PR Ready for review and merge.
  3. Cut the next release and confirm npm view @mcptoolshop/ai-loadout@<version> --json shows _npmUser.name: "GitHub Actions" and a trustedPublisher block.
  4. Only then delete the NPM_TOKEN repo secret (retained until now as a quick revert path - this PR does not delete it).

🤖 Generated with Claude Code

This repo's release.yml authenticated npm publish via NODE_AUTH_TOKEN wired to the
NPM_TOKEN secret. That pattern failed in prod on 2026-06-02 when
@mcptoolshop/backprop-trace's NPM_TOKEN expired (npm masks an expired token as E404,
not 403). Switch to npm Trusted Publishing (OIDC), matching the proven backprop-trace
fix: remove NODE_AUTH_TOKEN/NPM_TOKEN from the publish step; add npm install -g
npm@latest (OIDC needs npm >= 11.5.1; Node 22 ships 10.9.x); keep id-token: write and
npm publish --provenance --access public.

Inert until a Trusted Publisher is configured on npmjs.com for @mcptoolshop/ai-loadout bound to
ai-loadout / release.yml. The NPM_TOKEN secret is intentionally retained as a revert
path until the first OIDC release is confirmed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant