fix(ci): publish via npm CLI for Trusted Publisher OIDC#76
Merged
Conversation
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>
Contributor
Deploying with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm publishwith404 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 staticNPM_TOKENno longer has rights.pnpm publishwas never exchanging the GitHub OIDC token. Two reasons:<11.0.7 doesn't perform the OIDC exchange; this repo is pinned to pnpm 10.32.1 viapackageManager, and bumping to pnpm 11 is a breaking jump (lockfile auto-migration vs.--frozen-lockfile;onlyBuiltDependenciesmoves out of package.json).npm publish --provenance --access public.id-token: writeis already granted on this workflow, so the OIDC exchange runs automatically with no static token configured. Drop the now-unused hardcodedregistry-urlon the composite setup action and theNODE_AUTH_TOKENenv 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:
TightknitAIblock-kitchenrelease-please.ymlTest plan
NPM_TOKENrepo secret for hygiene.🤖 Generated with Claude Code