Skip to content

Commit add3cbb

Browse files
committed
fix: clear stale auth token before npm publish for trusted publishing
1 parent d18eddd commit add3cbb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ jobs:
9494
9595
- name: Publish to npm
9696
if: inputs.dry-run == false
97-
run: npm publish --provenance --access public
97+
run: |
98+
# Remove any auth token from .npmrc so npm uses OIDC Trusted Publishing
99+
npm config delete //registry.npmjs.org/:_authToken || true
100+
npm publish --provenance --access public
98101
99102
- name: Publish to npm (dry run)
100103
if: inputs.dry-run == true
101-
run: npm publish --provenance --access public --dry-run
104+
run: |
105+
npm config delete //registry.npmjs.org/:_authToken || true
106+
npm publish --provenance --access public --dry-run
102107
103108
- name: Create GitHub Release
104109
if: inputs.dry-run == false

0 commit comments

Comments
 (0)