ci(release): switch to npm trusted publishing (OIDC) - #153
Merged
Merged
Conversation
Replace expired NPM_TOKEN with npm trusted publishing (OIDC-based short-lived tokens from GitHub Actions). @semantic-release/npm 13.1+ auto-detects OIDC when id-token: write permission is granted. Changes: - release.yml: add environment: npm, permissions block with id-token: write, registry-url for setup-node, clear NODE_AUTH_TOKEN to avoid actions/setup-node auto-setting it (which overrides OIDC) - package.json: add publishConfig with provenance: true Requires npm-side config on npmjs.com: Package → Settings → Trusted Publisher → GitHub Actions Owner: plumelo, Repo: rollup-plugin-styler, Workflow: release.yml, Environment: npm, toggle 'Require OIDC only' Once first OIDC publish succeeds, delete the NPM_TOKEN GitHub secret.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
=======================================
Coverage 98.97% 98.97%
=======================================
Files 36 36
Lines 974 974
Branches 317 317
=======================================
Hits 964 964
Misses 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace expired
NPM_TOKENwith npm trusted publishing (OIDC-based short-lived tokens from GitHub Actions).@semantic-release/npm13.1+ auto-detects OIDC whenid-token: writepermission is granted — no plugin config change needed.Changes
.github/workflows/release.ymlenvironment: npmto the release jobpermissionsblock withid-token: write(OIDC key permission)registry-url: https://registry.npmjs.orgtosetup-nodeNPM_TOKENenv var withNODE_AUTH_TOKEN: ""(clears the auto-set token fromsetup-nodethat would override OIDC)package.jsonpublishConfigwithregistryandprovenance: trueRequired npm-side setup (manual)
On npmjs.com →
rollup-plugin-stylerpackage → Settings → Trusted Publisher → GitHub Actions:plumelorollup-plugin-stylerrelease.ymlnpmThen toggle "Require OIDC only".
After first successful OIDC publish
Delete the
NPM_TOKENsecret from GitHub repo settings (Settings → Secrets and variables → Actions).Safety
@semantic-release/npmfalls back toNPM_TOKENif OIDC isn't available, so this is safe to merge before the npm-side config is complete