Skip to content

ci: publish to npm via OIDC Trusted Publishing#8

Open
msilivonik-sc wants to merge 1 commit into
mainfrom
ci/npm-oidc-trusted-publishing
Open

ci: publish to npm via OIDC Trusted Publishing#8
msilivonik-sc wants to merge 1 commit into
mainfrom
ci/npm-oidc-trusted-publishing

Conversation

@msilivonik-sc
Copy link
Copy Markdown
Collaborator

@msilivonik-sc msilivonik-sc commented Jun 4, 2026

Summary

  • Switch the npm publish workflow from a long-lived NPM_TOKEN secret to short-lived OIDC tokens via npm Trusted Publishing.
  • Grant id-token: write, upgrade npm to @latest (Trusted Publishing needs npm >= 11.5.1), drop NODE_AUTH_TOKEN, and add --provenance for attestation.

Test plan

  • Trusted Publisher configured on npmjs.com pointing at publish.yml
  • Tag a release and confirm the workflow publishes via OIDC
  • Verify the published version carries a provenance badge
  • Remove NPM_TOKEN repo secret after first successful publish

Switch the npm publish workflow from a long-lived NPM_TOKEN secret to
short-lived OIDC tokens via npm Trusted Publishing. Grant id-token: write,
upgrade npm to @latest (Trusted Publishing needs npm >= 11.5.1), drop
NODE_AUTH_TOKEN, and add --provenance for attestation.

Required setup on npmjs.com before the next release tag:
1. npmjs.com -> @snap/react-camera-kit settings -> Publishing access ->
   Add trusted publisher -> GitHub Actions
2. Org: Snapchat, Repo: react-camera-kit, Workflow filename: publish.yml,
   Environment: blank
3. After the first successful OIDC publish, delete the NPM_TOKEN repo secret.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant