Repository navigation
ci: publish canary releases via npm trusted publishing (OIDC) - #536
Merged
Merged
Conversation
The NPM_AUTH_TOKEN secret is rejected by the registry (E404 on PUT), so switch canary-publish.yml to npm trusted publishing (GitHub OIDC): - grant id-token: write (contents: read is all the job needs) - run the job on Node 24, which bundles npm 11; guard that npm is >= 11.5.1 before publishing - drop NODE_AUTH_TOKEN from the publish step so no stale token is used Provenance is generated automatically. publish.yml is unchanged until a trusted publisher is configured for it.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Why
The canary run for v0.5.x (run 37733931253, e105a08) got through install and build, then failed at
npm publishwithE404 Not Found - PUT https://registry.npmjs.org/@offckb%2fcli. The registry is rejecting theNPM_AUTH_TOKENsecret. A trusted publisher (GitHub Actions,ckb-devrel/offckb, workflowcanary-publish.yml, no environment,npm publishallowed) is now configured on npmjs.com for@offckb/cli, so canary releases can authenticate with OIDC and no longer need a long-lived token.Changes (
.github/workflows/canary-publish.ymlonly)id-token: write, which OIDC requires, andcontents: read, replacing the unusedcontents: write.24.x, which bundles npm 11. Trusted publishing needs Node >= 22.14 and npm >= 11.5.1. A small guard step upgrades npm to^11.5.1only if the bundled one is older.NODE_AUTH_TOKEN/secrets.NPM_AUTH_TOKENare removed from the publish step.registry-urlis still set on setup-node.pnpm/action-setup@v4(version 10) withpnpm install --frozen-lockfile. The-canary-<sha>version suffix and--tag canarywork as before. No caching was added.Locally,
pnpm buildandtest:cipass on Node 24.21.0. The only test failures are the 2 knownlsofenvironment failures.engines.nodeis>=20.0.0.publish.ymlis intentionally unchanged, because no trusted publisher is configured for it yet. An empty changeset is included for Verify Changeset.After merge
Merge develop into v0.5.x with a merge commit to trigger the canary. The trusted publisher config expires if its first successful publish doesn't happen within 2 days.