Skip to content

Publish to npm through trusted publishing - #58

Merged
jonathan-kosgei merged 1 commit into
mainfrom
trusted-publishing
Nov 3, 2026
Merged

jonathan-kosgei merged 1 commit into
mainfrom
trusted-publishing

Conversation

@jonathan-kosgei

@jonathan-kosgei jonathan-kosgei commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The publish job in release.yml authenticates with the job's OpenID Connect token through the package's trusted publisher configuration on npmjs.com instead of a stored npm token. The NPM_AUTH_TOKEN secret is no longer referenced and can be deleted. A workflow_dispatch input allows publishing an existing tag on demand.

How it works

  • The job already had id-token: write; npm 11.5.1 or newer exchanges that token with the registry, so the runner's npm is updated before publishing.
  • npm publish --provenance --access public is unchanged; provenance continues to be attached.
  • gh workflow run release.yml -f tag=v3.1.0 publishes a tag that already exists, which the automatic release path skips.

Verification

  • YAML parses; actionlint reports no findings.
  • The first run against the trusted publisher configuration validates it on npmjs.com.

🤖 Generated with Claude Code

The publish job authenticates with the job's OpenID Connect token via the
package's trusted publisher configuration on npmjs.com instead of a stored
npm token, so the NPM_AUTH_TOKEN secret is no longer used. The runner's
npm is updated to the current release because the OIDC flow needs npm
11.5.1 or newer. A workflow_dispatch input allows publishing an existing
tag on demand.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jonathan-kosgei
jonathan-kosgei merged commit cef6918 into main Nov 3, 2026
8 checks passed
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.

2 participants