Skip to content

Commit 1ef45ee

Browse files
committed
fix npm publish
1 parent b3daf97 commit 1ef45ee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ jobs:
6868
needs: test-and-build
6969
name: Publish to npm
7070
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish-npm)
71-
71+
72+
permissions:
73+
contents: read
74+
id-token: write # Required for npm OIDC publish
75+
7276
steps:
7377
- name: Checkout code
7478
uses: actions/checkout@v5
@@ -78,7 +82,6 @@ jobs:
7882
with:
7983
node-version: '20.x'
8084
registry-url: 'https://registry.npmjs.org/'
81-
cache: 'npm'
8285

8386
- name: Install dependencies
8487
run: npm ci
@@ -93,10 +96,8 @@ jobs:
9396
if: github.event_name == 'workflow_dispatch'
9497
run: npm version ${{ inputs.version }} --no-git-tag-version
9598

96-
- name: Publish to npm
99+
- name: Publish to npm (via OIDC trusted publisher)
97100
run: npm publish --access public
98-
env:
99-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
100101

101102
publish-docker:
102103
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)