Skip to content

Commit 2517887

Browse files
committed
Fix: Use explicit OIDC token for npm publish
1 parent 1036772 commit 2517887

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ jobs:
4949
run: |
5050
npm version "${{ steps.release_version.outputs.version }}" --no-git-tag-version
5151
52-
- name: Debug npm config
53-
run: |
54-
npm config list
55-
echo "---"
56-
cat ~/.npmrc 2>/dev/null || echo "No ~/.npmrc found"
52+
- name: Get OIDC token
53+
id: oidc
54+
uses: actions/github-script@v7
55+
with:
56+
script: |
57+
const token = await core.getIDToken('https://registry.npmjs.org');
58+
core.setOutput('token', token);
5759
5860
- name: Publish to npm (Trusted Publishing)
5961
run: npm publish --access public --provenance
62+
env:
63+
NODE_AUTH_TOKEN: ${{ steps.oidc.outputs.token }}

.npmrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)