Skip to content

fix(ci): publish via npm CLI for Trusted Publisher OIDC#76

Merged
zhawtof merged 1 commit into
mainfrom
fix/ci-trusted-publisher-oidc
May 20, 2026
Merged

fix(ci): publish via npm CLI for Trusted Publisher OIDC#76
zhawtof merged 1 commit into
mainfrom
fix/ci-trusted-publisher-oidc

Conversation

@zhawtof
Copy link
Copy Markdown
Contributor

@zhawtof zhawtof commented May 20, 2026

Summary

  • The 0.8.1 release-please run failed at pnpm publish with 404 Not Found - PUT /@tightknitai/block-kitchen. The package exists with the right maintainers, so this is npm's standard signal that the bearer token doesn't have write access — i.e. OIDC wasn't being used and the static NPM_TOKEN no longer has rights.
  • Trusted Publisher is now configured on npmjs.com for this package, but pnpm publish was never exchanging the GitHub OIDC token. Two reasons:
    • pnpm < 11.0.7 doesn't perform the OIDC exchange; this repo is pinned to pnpm 10.32.1 via packageManager, and bumping to pnpm 11 is a breaking jump (lockfile auto-migration vs. --frozen-lockfile; onlyBuiltDependencies moves out of package.json).
    • Node 22 ships npm 10.x; Trusted Publisher OIDC support in the npm CLI landed in 11.5.1.
  • Install the latest npm CLI before publish and call npm publish --provenance --access public. id-token: write is already granted on this workflow, so the OIDC exchange runs automatically with no static token configured. Drop the now-unused hardcoded registry-url on the composite setup action and the NODE_AUTH_TOKEN env on the publish step.

Mirrors TightknitAI/slack-block-kit-validator#34.

Verify on npmjs.com

Trusted Publisher fails closed when any of these don't match the workflow exactly:

  • Owner: TightknitAI
  • Repository: block-kitchen
  • Workflow filename: release-please.yml
  • Environment: leave empty

Test plan

  • Merge and let the next release-please PR (or a re-run of 0.8.1) exercise publish.
  • Confirm the version lands on npm with provenance attestation.
  • Once green, delete the unused NPM_TOKEN repo secret for hygiene.

🤖 Generated with Claude Code

The 0.8.1 release-please run failed at `pnpm publish` with a 404 PUT —
npm's standard signal that the bearer token doesn't have write access.
Since the package is now configured for Trusted Publisher on npmjs.com,
we should be exchanging the GitHub OIDC token instead of presenting a
static NPM_TOKEN.

Two reasons that wasn't happening:

- pnpm <11.0.7 does not perform the OIDC exchange and uses the static
  `_authToken` instead. This repo is pinned to pnpm 10.32.1 via
  `packageManager`, and bumping to pnpm 11 is a breaking jump
  (lockfile auto-migration vs. `--frozen-lockfile`, and
  `onlyBuiltDependencies` has to move out of package.json).
- Node 22 ships npm 10.x; Trusted Publisher OIDC support in the npm
  CLI landed in 11.5.1.

So install the latest npm before publish and run `npm publish` from
it. `id-token: write` was already granted on this workflow, so the
OIDC exchange runs automatically with no token configured. Drops
the now-unused hardcoded `registry-url` on the composite setup
action and the `NODE_AUTH_TOKEN` env on the publish step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages Bot commented May 20, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
block-kitchen 466db1a Commit Preview URL

Branch Preview URL
May 20 2026, 07:05 AM

@zhawtof zhawtof merged commit aab5ec8 into main May 20, 2026
13 checks passed
@zhawtof zhawtof deleted the fix/ci-trusted-publisher-oidc branch May 20, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant