Skip to content

Add npm trusted publishing support#44

Merged
jgoz merged 2 commits intomasterfrom
add-npm-trusted-publishing
Oct 21, 2025
Merged

Add npm trusted publishing support#44
jgoz merged 2 commits intomasterfrom
add-npm-trusted-publishing

Conversation

@jgoz
Copy link
Copy Markdown
Contributor

@jgoz jgoz commented Oct 21, 2025

This PR adds support for npm trusted publishing via OIDC, which allows automated publishing without requiring OTP tokens.

Changes

  • Added id-token: write, contents: write, and pull-requests: write permissions to the release job
  • Added npm update step to ensure latest npm version for provenance support
  • Replaced --otp=1 with --provenance flag in the npm publish command
  • Added changeset for this change
  • This enables automated publishing via OIDC authentication

Benefits

  • No more manual OTP entry required for publishing
  • Enhanced security through OIDC-based authentication
  • Automatic provenance generation for published packages

References

Next Steps

After merging this PR, you'll need to configure the trusted publisher on npm:

  1. Go to https://www.npmjs.com/package/chronoshift/access
  2. Set up GitHub Actions as a trusted publisher
  3. Configure the repository, workflow file, and job name

- Add id-token, contents, and pull-requests write permissions to release job
- Add npm update step to ensure latest npm version for provenance support
- Replace --otp=1 with --provenance flag for npm publish
- Enables automated publishing via OIDC without requiring OTP
Comment thread .github/workflows/release.yml Outdated
@jgoz jgoz merged commit 6ad69ec into master Oct 21, 2025
1 check 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