Skip to content

Commit d15d547

Browse files
committed
feat: add npm provenance support for supply chain security [patch]
- Add id-token: write permission for Sigstore signing - Add --provenance flag to npm publish command - Add comprehensive provenance implementation guide - Update release notes to indicate provenance status This enables cryptographic proof linking published packages to their source repository and build instructions.
1 parent 55dc213 commit d15d547

File tree

2 files changed

+674
-3
lines changed

2 files changed

+674
-3
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
if: contains(github.event.head_commit.message, '[patch]') || contains(github.event.head_commit.message, '[minor]') || contains(github.event.head_commit.message, '[major]')
1111
runs-on: ubuntu-latest
1212

13+
# Required permissions for npm provenance
14+
permissions:
15+
contents: write # For creating tags and releases
16+
id-token: write # Required for npm provenance attestation
17+
1318
steps:
1419
- name: Checkout code
1520
uses: actions/checkout@v4
@@ -76,8 +81,8 @@ jobs:
7681
- name: Build package
7782
run: npm run package
7883

79-
- name: Publish to npm
80-
run: npm publish
84+
- name: Publish to npm with provenance
85+
run: npm publish --provenance --access public
8186
env:
8287
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8388

@@ -98,5 +103,7 @@ jobs:
98103
body: |
99104
Automated release v${{ steps.new-version.outputs.version }}
100105
106+
✅ Published with npm provenance
107+
101108
Changes in this release:
102-
- ${{ github.event.head_commit.message }}
109+
- ${{ github.event.head_commit.message }}

0 commit comments

Comments
 (0)