Skip to content

Commit 245d18f

Browse files
committed
fix: GHA - use npm provenance
1 parent 0bfbc61 commit 245d18f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Build-Test-Release
22

3+
permissions:
4+
contents: write
5+
id-token: write
6+
actions: write
7+
38
on:
49
push:
510
branches:
@@ -19,6 +24,11 @@ jobs:
1924
with:
2025
# Keep in sync with volta -> node version in package.json
2126
node-version: 20
27+
registry-url: https://registry.npmjs.org
28+
cache: yarn
29+
30+
- name: Ensure npm supports OIDC
31+
run: npm i -g npm@latest
2232

2333
- name: Install dependencies
2434
run: yarn
@@ -30,7 +40,7 @@ jobs:
3040
dry_run: true
3141
env:
3242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
NPM_CONFIG_PROVENANCE: true
3444

3545
- name: Update version in package.json
3646
if: steps.next_version.outputs.new_release_version
@@ -64,7 +74,7 @@ jobs:
6474
uses: cycjimmy/semantic-release-action@v4
6575
env:
6676
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
NPM_CONFIG_PROVENANCE: true
6878

6979
- name: Trigger dependent builds if release published
7080
if: steps.semantic_release.outputs.new_release_published == 'true'

0 commit comments

Comments
 (0)