Skip to content

Commit 86f147a

Browse files
ci: use OIDC trusted publishing with provenance
1 parent 30f2178 commit 86f147a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
13+
id-token: write
1314

1415
steps:
1516
- uses: actions/checkout@v4
@@ -43,9 +44,14 @@ jobs:
4344
echo "changed=false" >> "$GITHUB_OUTPUT"
4445
fi
4546
47+
- name: Setup npm for publishing
48+
if: steps.version.outputs.changed == 'true'
49+
run: |
50+
echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc
51+
4652
- name: Publish to npm
4753
if: steps.version.outputs.changed == 'true'
48-
run: npm publish --access public
54+
run: npm publish --access public --provenance
4955

5056
- name: Create GitHub Release
5157
if: steps.version.outputs.changed == 'true'

0 commit comments

Comments
 (0)