Repository navigation
ci(publish): publish via npm trusted publishing instead of NPM_TOKEN - #6
Merged
Merged
Conversation
The publish job authenticated with a long-lived NPM_TOKEN secret, which expired (npm caps tokens with write access at 90 days) and broke the 0.3.0 release with a 404 on PUT. Switch to npm trusted publishing (OIDC): npm trades the job's GitHub identity token for a short-lived publish credential, so there is no secret to store, leak, or expire. - publish.yml: grant `id-token: write`; run on Node 24, whose bundled npm (>= 11.5.1) is required for trusted publishing; drop NODE_AUTH_TOKEN; drop the npm cache, as npm advises for release builds - package.json: add `repository`, which must match the GitHub repo since trusted publishing attaches a provenance attestation - CLAUDE.md: describe the new publishing setup 0.3.0 is already on the registry, so merging this is a no-op publish; the next version bump is the first release over OIDC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015XnPdQXFWDT6FTnQs1d1f1
lonetis
marked this pull request as ready for review
October 20, 2026 12:52
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 20, 2026
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
The 0.3.0 release failed at the
npm publishstep withE404 Not Found - PUT https://registry.npmjs.org/claudeleaf. That's how npm reports a rejected token, and theNPM_TOKENsecret had most likely expired: npm caps tokens with publish rights at 90 days. 0.3.0 has since been published from a re-run with a new token.This PR switches the Publish workflow to npm trusted publishing (OIDC) so releases don't depend on a token. npm trades the job's GitHub identity token for a short-lived publish credential, so there's no secret to store, leak or expire. The trusted publisher is already set up on npmjs.com (
lonetis/claudeleaf,publish.yml).Changes
.github/workflows/publish.ymlid-token: write, which trusted publishing needsnode-version: "20"→"24": trusted publishing needs npm ≥ 11.5.1, which Node 24 bundles (Node 20's npm 10 can't use it)NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}envcache: npm, as npm's docs advise for release buildspackage.json: addsrepository(git+https://github.com/lonetis/claudeleaf.git). Trusted publishing attaches a provenance attestation for public repos, and npm rejects the publish ifrepository.urldoesn't match the repo. The field was missing, so the first OIDC publish would have failed without it.CLAUDE.md: updates the Publishing & CI section.Verification
npm run typecheckandnpm testpass on Node 22 and on Node 24.22 (93 passed; 25 live tests skipped without a cached session).npm ciworks with the unchanged lockfile, andnpm pkg fixleaves the newrepositoryfield as is, so it's already in npm's canonical form.npm view <pkg>@<ver>still distinguishes published versions (exit 0) from unpublished ones (exit 1) withsetup-node's placeholder token in.npmrc. The workflow's "already published?" check depends on this.After merging
NPM_TOKENrepo secret and revoke that token on npmjs.com.Generated by Claude Code