Skip to content

Enable provenance and improve npm publish security#26

Merged
sam-mfb merged 2 commits into
mainfrom
claude/fix-npm-publish-action-D0TZ1
Mar 11, 2026
Merged

Enable provenance and improve npm publish security#26
sam-mfb merged 2 commits into
mainfrom
claude/fix-npm-publish-action-D0TZ1

Conversation

@sam-mfb

@sam-mfb sam-mfb commented Mar 11, 2026

Copy link
Copy Markdown
Owner

Summary

This PR enhances the npm publishing workflow by enabling provenance attestation and improving security posture through explicit permission declarations.

Key Changes

  • Added explicit permissions block at workflow level with contents: read and id-token: write permissions
  • Added permissions block to the build job with the same permissions
  • Updated npm publish command to include --provenance flag for supply chain security attestation
  • Added --access public flag to ensure the package is published as public

Implementation Details

The changes implement OIDC (OpenID Connect) token-based authentication for npm publishing, which is more secure than token-based authentication. The id-token: write permission is required to generate the OIDC token that npm can verify, while contents: read allows the workflow to access the repository contents. The --provenance flag enables npm to create a signed provenance statement that can be verified by consumers of the package.

https://claude.ai/code/session_01DwC5irUcgWuxsW2iRH5APK

claude added 2 commits March 11, 2026 00:05
Add id-token: write permission and --provenance --access public flags
needed for npm trusted publisher authentication via GitHub Actions OIDC.

https://claude.ai/code/session_01DwC5irUcgWuxsW2iRH5APK
- Upgrade Node to 24.x (OIDC trusted publishing requires npm >= 11.5.1)
- Add npm install -g npm@latest to ensure latest npm with OIDC support
- Remove NODE_AUTH_TOKEN secret (not needed with trusted publishers)
- Add id-token: write permission for OIDC authentication
- Add --provenance --access public flags for trusted publishing

https://claude.ai/code/session_01DwC5irUcgWuxsW2iRH5APK
@sam-mfb sam-mfb merged commit 60fcea1 into main Mar 11, 2026
2 checks passed
@sam-mfb sam-mfb deleted the claude/fix-npm-publish-action-D0TZ1 branch March 11, 2026 00:10
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