ci: migrate npm release to OIDC trusted publishing with provenance - #203
Merged
Conversation
Replace the long-lived NPM_TOKEN secret with GitHub Actions OIDC trusted publishing and enable npm provenance attestations. - release.yaml: grant `id-token: write`, drop the `NPM_TOKEN` env var and the hand-written ~/.npmrc step. The pinned pnpm (11.1.2 via corepack) detects the GitHub Actions OIDC environment and exchanges it for a short-lived publish credential, so no static token is needed. - Add `--provenance` to every package's `build:publish` script so each package is published with a signed provenance attestation. - Add a `repository` field (with monorepo `directory`) to the redis, rabbitmq, nats and zeromq providers and a `directory` to qified; npm provenance requires a public `repository` matching the publish source. https://claude.ai/code/session_015xP5N3Wz14pL14dc3pyYsg
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the package.json files for several packages (nats, qified, rabbitmq, redis, and zeromq) by adding the --provenance flag to the publishing script and specifying the repository details along with their respective directories. There are no review comments, and I have no feedback to provide.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #203 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 1392 1392
Branches 247 248 +1
=========================================
Hits 1392 1392 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Migrates the release pipeline from a long-lived
NPM_TOKENsecret to GitHub Actions OIDC trusted publishing, and enables npm provenance attestations for every published package. Everything stays on pnpm — nonpm/npxinvocations are introduced.The repo already pins
pnpm@11.1.2viapackageManager+ corepack. pnpm's native publish flow (since 11.0) handles the OIDC token exchange and provenance itself using bundledlibnpmpublish, so no systemnpmupgrade is required.Changes
.github/workflows/release.yamlid-token: writepermission so the job can mint the OIDC token npm exchanges for a short-lived publish credential.env: NPM_TOKENand the hand-written~/.npmrcstep — no static token is needed anymore.pnpm publish:packages.packages/*/package.json(all 5 packages)--provenanceto eachbuild:publishscript (pnpm publish --provenance --access public --no-git-checks).repositoryfield with a monorepodirectoryto theredis,rabbitmq,nats, andzeromqproviders, and adirectorytoqified. npm provenance requires a publicrepositorythat matches the source it is published from, so the providers (which had norepositoryfield) would have failed provenance generation without this.OIDC trusted publishing won't authenticate until a trusted publisher is configured on npmjs.com for each package (
qified,@qified/redis,@qified/rabbitmq,@qified/nats,@qified/zeromq). On each package's npm settings page → Trusted Publishers, add a GitHub Actions publisher with (case-sensitive):jaredwrayqifiedrelease.yamlOnce configured, the
NPM_TOKENrepo secret can be deleted. Trusted publishing requires a cloud-hosted runner (ubuntu-latest✓) and public repo for provenance to be emitted — both already satisfied.Verification
package.jsonfiles validated as parseable JSON;repository/build:publishfields confirmed correct.11.1.2resolves via corepack and accepts--provenance(a deliberately bogus flag is rejected withUnknown option, while--provenancepasses), and thatprovenanceis a recognized pnpm config key.secrets.*/NODE_AUTH_TOKEN/.npmrc.https://claude.ai/code/session_015xP5N3Wz14pL14dc3pyYsg
Generated by Claude Code