fix(ci): publish via npm trusted publishing instead of a stale token - #19
Merged
Conversation
The publish job has failed on every run since 2026-05-15. The tarball builds fine; only the registry call fails, with: npm error code E404 npm error 404 Not Found - PUT https://registry.npmjs.org/@blindpay%2fcli npm error 404 The requested resource '@blindpay/[email protected]' could not be found or you do not have permission to access it. Cause: the job passed NODE_AUTH_TOKEN from secrets.NPM_TOKEN. setup-node writes that into .npmrc as _authToken, which takes precedence over the OIDC exchange and disables trusted publishing. The token itself was created 2026-03-06 and npm granular tokens expire within 90 days, so it went dead in early June. Every failure from 2026-06-17 onward is a real version bump (0.2.0, 0.3.0, 0.3.1, 0.4.0) rejected on auth, not a version conflict. blindpay-node's publish workflow is byte-identical except that it passes no token, and it publishes successfully with SLSA provenance attestations. This aligns cli with it. A trusted publisher is now configured on npmjs.com for @blindpay/cli pointing at blindpaylabs/blindpay-cli and publish.yml. npm is stuck at 0.1.1 while main is 0.4.0, so merging this ships three releases' worth of accumulated work, including the receivers to customers command rename. Also: - Skip instead of fail when package.json's version is already on the registry. The job runs on every push to main, so an unchanged version was failing the run and burying real failures in noise. - Tag and create a GitHub release on publish. The repo has no tags at all today. - Drop `ref: github.head_ref`, which is empty on a push event. Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
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.
Problem
publish.ymlhas failed on every run since 2026-05-15 (13 failures, 2 successes ever). npm is stuck at 0.1.1 whilemainis at 0.4.0, so thereceiverstocustomerscommand rename has never reached users.The build is fine. Only the registry call fails:
Cause
The job passed
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}.setup-nodewrites that into.npmrcas_authToken, which takes precedence over the OIDC exchange and disables trusted publishing. The secret was created 2026-03-06, and npm granular tokens expire within 90 days, so it died in early June.The timeline separates the two failure modes cleanly:
cannot publish over the previously published versions(benign)E404on auth (real)blindpay-node/.github/workflows/publish.yamlis byte-identical except that it passes no token, and it publishes successfully with SLSA provenance attestations (npm view @blindpay/node dist.attestations). This aligns cli with it.A trusted publisher is now configured on npmjs.com for
@blindpay/cli, pointing atblindpaylabs/blindpay-cliandpublish.yml, withnpm publishandnpm stage publishpermissions.Changes
NODE_AUTH_TOKENenv block so the OIDC exchange runs.id-token: writewas already present.package.json's version is already on the registry. The job runs on every push tomain, so an unchanged version failed the run and buried real failures in noise.ref: ${{ github.head_ref }}, which is empty on apushevent.Verification
bun install --frozen-lockfileandbun run buildpass locally on this branch (bundled 20 modules, 122.95 KB entry point).publish.ymlparses as valid YAML.Follow-up
Once a publish succeeds, the dead secret can go:
https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs