Skip to content

fix: use OIDC trusted publishing instead of NPM_TOKEN#33

Merged
Dhravya merged 1 commit intomainfrom
vorflux/fix-oidc-publish
Apr 17, 2026
Merged

fix: use OIDC trusted publishing instead of NPM_TOKEN#33
Dhravya merged 1 commit intomainfrom
vorflux/fix-oidc-publish

Conversation

@vorflux
Copy link
Copy Markdown

@vorflux vorflux bot commented Apr 17, 2026

Summary

The publish workflow was failing with ENEEDAUTH because NPM_TOKEN secret is not configured in this repo. Instead of adding a token, this switches to npm OIDC trusted publishing which authenticates via GitHub Actions' built-in OIDC identity -- no secrets needed.

Root Cause

actions/setup-node with registry-url creates an .npmrc containing ${NODE_AUTH_TOKEN}. When NPM_TOKEN isn't set in the repo secrets, that variable resolves to an empty string. npm then attempts token-based auth with the empty string and fails with ENEEDAUTH instead of falling through to OIDC.

Changes

  • Removed NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} -- not needed with OIDC
  • Removed registry-url from actions/setup-node -- prevents .npmrc from being generated with an empty token placeholder that blocks OIDC fallback
  • Removed NPM_CONFIG_PROVENANCE env var -- replaced with --provenance flag directly on the publish command
  • Added node-version: '24' -- npm CLI 11.5.1+ is required for OIDC trusted publishing
  • The id-token: write permission was already set, which is what OIDC needs

Prerequisite

The package code-chunk must have a trusted publisher configured on npmjs.com pointing to:

  • Repository: supermemoryai/code-chunk
  • Workflow: release.yml

See npm trusted publishing docs for setup.

Testing

  • YAML syntax validated
  • Reviewed failed run logs (run 24543674622) confirming ENEEDAUTH due to empty NODE_AUTH_TOKEN
  • Verified the fix removes both the token dependency and the registry-url that generates the problematic .npmrc

Session Details

  • Session: View Session
  • Requested by: Unknown
  • Address comments on this PR. Add (aside) to your comment to have me ignore it.

- Remove NODE_AUTH_TOKEN/NPM_TOKEN dependency (not needed with OIDC)
- Use --provenance flag directly on npm publish
- Pin node-version to 24 (npm 11.5.1+ required for OIDC trusted publishing)
- Requires trusted publisher configured on npmjs.com for this package
@Dhravya Dhravya merged commit f26ebc0 into main Apr 17, 2026
5 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.

1 participant