Skip to content

Commit 53b1e8f

Browse files
authored
Enable NPM trusted publishing with OIDC (#3)
## Summary Update npm publish workflow to use OIDC trusted publishing with provenance. ## Changes - Add `id-token: write` and `contents: read` permissions for OIDC authentication - Update to `npx npm@11.7.0 publish` with `--provenance` flag for supply chain security - Update actions to v6 - Remove `NODE_AUTH_TOKEN` secret (no longer needed with OIDC) ## Status ✅ Trusted publishing has been configured on npmjs.com for this package.
1 parent 5d36c49 commit 53b1e8f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ on:
1010
jobs:
1111
wasm-lz4:
1212
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
17+
id-token: write
18+
1319
strategy:
1420
fail-fast: false
1521
matrix:
1622
node-version: [14.x, 16.x, 18.x]
1723

1824
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-node@v3
25+
- uses: actions/checkout@v6
26+
- uses: actions/setup-node@v6
2127
with:
2228
node-version: ${{ matrix.node-version }}
2329
registry-url: https://registry.npmjs.org
@@ -29,6 +35,4 @@ jobs:
2935

3036
- name: Publish to NPM
3137
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.node-version == '16.x' }}
32-
run: npm publish --access public
33-
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
38+
run: npx npm@11.7.0 publish --provenance --access public

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
22
node_modules/
3+
.DS_Store

0 commit comments

Comments
 (0)