Skip to content

Commit 37fa9d9

Browse files
committed
ci(npm): configure trusted publishing with OIDC
- Add job-level permissions (id-token: write, contents: read) - Add environment protection (npm) - Enable provenance attestations with --provenance flag - Remove NODE_AUTH_TOKEN in favor of OIDC authentication - Create .npmrc with provenance=true as fallback Ref: https://docs.npmjs.com/trusted-publishers
1 parent 633348c commit 37fa9d9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ jobs:
216216
runs-on: ubuntu-latest
217217
needs: npm-build
218218
timeout-minutes: 15
219+
permissions:
220+
id-token: write
221+
contents: read
222+
environment:
223+
name: npm
224+
url: https://www.npmjs.com/package/feedparser-rs
219225
steps:
220226
- uses: actions/checkout@v6
221227
- uses: actions/setup-node@v6
@@ -235,11 +241,9 @@ jobs:
235241
ls -lh prebuilts/
236242
- run: npm ci
237243
working-directory: crates/feedparser-rs-node
238-
- name: Publish
244+
- name: Publish with provenance
239245
working-directory: crates/feedparser-rs-node
240-
run: npm publish --access public
241-
env:
242-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
246+
run: npm publish --access public --provenance
243247

244248
# ============================================================================
245249
# GITHUB RELEASE

crates/feedparser-rs-node/.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable provenance attestations for supply chain security
2+
# https://docs.npmjs.com/generating-provenance-statements
3+
provenance=true

0 commit comments

Comments
 (0)