Skip to content

Commit bea1c7f

Browse files
committed
ci: strip dummy authToken and keep --provenance so OIDC credential is used
1 parent 0548453 commit bea1c7f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ jobs:
4040
- name: Publish
4141
run: |
4242
npm install -g npm@latest
43+
# setup-node writes a dummy _authToken into this .npmrc; remove it so
44+
# npm uses the OIDC-exchanged credential (not the fake token) for the
45+
# registry write. --provenance forces npm to engage OIDC.
46+
sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
4347
npm publish --access public --provenance

0 commit comments

Comments
 (0)