Skip to content

Commit 24cfb8b

Browse files
committed
ci(release): switch to npm trusted publishers with OIDC
Use GitHub OIDC authentication instead of NPM_TOKEN secret for publishing packages. This eliminates the need to manage and rotate npm access tokens. - Add environment: npm for OIDC trust policy - Add --provenance flag for package attestation - Remove NODE_AUTH_TOKEN secret usage
1 parent 37ca074 commit 24cfb8b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
name: Release Packages
3131
runs-on: ubuntu-latest
3232
timeout-minutes: 30
33+
environment: npm
3334
# Don't run on version bump commits to avoid infinite loop
3435
# Note: For push events on main, branch protection should require CI to pass before merge
3536
# For manual triggers, tests run inline below as a safety check
@@ -248,9 +249,7 @@ jobs:
248249
steps.release-type.outputs.is_prerelease == 'false' &&
249250
steps.release-type.outputs.is_dry_run == 'false' &&
250251
steps.version-production.outputs.has_changes == 'true'
251-
run: npx lerna publish from-git --yes --no-private
252-
env:
253-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
252+
run: npx lerna publish from-git --yes --no-private --provenance
254253

255254
- name: No changes detected
256255
if: |
@@ -273,9 +272,8 @@ jobs:
273272
--dist-tag ${{ steps.release-type.outputs.dist_tag }} \
274273
--no-git-reset \
275274
--yes \
276-
--no-private
277-
env:
278-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
275+
--no-private \
276+
--provenance
279277
280278
- name: Find PR for this branch
281279
if: steps.release-type.outputs.is_prerelease == 'true' && steps.release-type.outputs.is_dry_run == 'false'

0 commit comments

Comments
 (0)