Skip to content

Commit 11379a9

Browse files
committed
fix: gh action with id token permission for OIDC
1 parent 9900090 commit 11379a9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/publish-js.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ on:
55
types: [published]
66
workflow_dispatch:
77

8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: rea
11+
812
jobs:
913
publish:
1014
name: Publish to npm
1115
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
1216
runs-on: ubuntu-latest
1317
environment: npm
14-
permissions:
15-
contents: read
16-
id-token: write
18+
1719

1820
defaults:
1921
run:
@@ -26,7 +28,7 @@ jobs:
2628
- name: Set up Node
2729
uses: actions/setup-node@v4
2830
with:
29-
node-version: 20
31+
node-version: '24'
3032
registry-url: 'https://registry.npmjs.org'
3133
cache: npm
3234
cache-dependency-path: packages/js/package-lock.json
@@ -46,7 +48,7 @@ jobs:
4648
npm pkg get name version
4749
4850
- name: Build
49-
run: npm run build
51+
run: npm run build --if-present
5052

51-
- name: Publish to npm
52-
run: npm publish --provenance --access public
53+
- name: Publish
54+
run: npm publish

0 commit comments

Comments
 (0)