Skip to content

Enable npm OIDC trusted publisher with provenance#413

Merged
jonluca merged 1 commit intomainfrom
jonluca/npm-oidc-publish
Feb 28, 2026
Merged

Enable npm OIDC trusted publisher with provenance#413
jonluca merged 1 commit intomainfrom
jonluca/npm-oidc-publish

Conversation

@jonluca
Copy link
Member

@jonluca jonluca commented Feb 28, 2026

Summary

Enable GitHub Actions to publish packages to npm using OIDC (OpenID Connect) instead of token-based authentication. Adds provenance attestation to link published packages to this workflow run.

Changes

  • Added id-token: write permission to the release job for OIDC token generation
  • Configured npm registry URL in setup-node step
  • Enabled provenance statement generation via NPM_CONFIG_PROVENANCE

Why

OIDC trusted publishing is more secure than token-based auth. It eliminates the need to manage long-lived secrets and provides cryptographic proof that packages were published by this specific workflow.

Add id-token permission and configure registry URL for npm OIDC authentication. Enable NPM_CONFIG_PROVENANCE to generate package attestations linked to this GitHub Actions workflow.
@jonluca jonluca enabled auto-merge (squash) February 28, 2026 18:45
@jonluca jonluca merged commit a84513c into main Feb 28, 2026
13 checks passed
@jonluca jonluca deleted the jonluca/npm-oidc-publish branch February 28, 2026 18:46
@github-actions
Copy link

Pull Request Test Coverage Report for Build 22526726748

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 86.701%

Totals Coverage Status
Change from base Build 22526630049: 0.0%
Covered Lines: 999
Relevant Lines: 1118

💛 - Coveralls

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