Skip to content

Commit ce76c82

Browse files
SavioBS629claude
andcommitted
fix(ci): add npm provenance to release publish
Adds --provenance to the npm publish step and the required id-token: write permission. Attaches a signed attestation to the published package so consumers can verify it was built by this exact workflow on this repo. Defends against trojaned releases via a compromised maintainer machine or NPM_TOKEN. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent dddba30 commit ce76c82

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
permissions:
77
contents: write
8+
id-token: write
89

910
jobs:
1011
publish:
@@ -99,7 +100,7 @@ jobs:
99100
run: git push origin ${{ steps.get_version.outputs.version }}
100101

101102
- name: "Publish to NPM"
102-
run: npm publish --access public
103+
run: npm publish --access public --provenance
103104
env:
104105
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
105106

0 commit comments

Comments
 (0)