Skip to content

Switch to OIDC trusted publishing for npm releases - #7

Merged
dmchaledev merged 1 commit into
mainfrom
claude/festive-sagan-FoEfA
May 29, 2026
Merged

dmchaledev merged 1 commit into
mainfrom
claude/festive-sagan-FoEfA

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

This PR updates the npm publish workflow to use OIDC (OpenID Connect) trusted publishing instead of relying on a static NPM_PUBLISH_TOKEN secret. This is a more secure approach that leverages GitHub's native OIDC provider to authenticate with npm.

Key Changes

  • Update npm version: Added a step to upgrade npm to the latest version (>= 11.5.1) since the version bundled with Node 20 doesn't support OIDC trusted publishing
  • Remove token-based authentication: Removed the NODE_AUTH_TOKEN environment variable and the explicit --provenance --access public flags from the publish command
  • Simplify publish command: Changed from npm publish --provenance --access public to just npm publish, with authentication and access configuration now handled by OIDC and npm's publishConfig settings
  • Update documentation: Added inline comments explaining that OIDC trusted publishing is configured on npmjs.com and that access/provenance settings come from publishConfig

Implementation Details

  • OIDC trusted publishing must be configured on npmjs.com for this to work
  • The npm version upgrade ensures compatibility with OIDC authentication
  • Access level and provenance settings are now managed through the package's publishConfig rather than CLI flags

https://claude.ai/code/session_01NdYBDPwbpmBUMFUsrqotE1

Drop NODE_AUTH_TOKEN/NPM_PUBLISH_TOKEN in favor of OIDC trusted
publishing, and upgrade npm to a version (>=11.5.1) that supports it.
access and provenance are already set via publishConfig.
@dmchaledev
dmchaledev merged commit 5495ebc into main May 29, 2026
1 of 3 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