Skip to content

Commit f8d4307

Browse files
authored
ci: add provenance to all published packages (#25)
This commit adds provenance for all published packages. See the NPM documentation [0]. Provenance will allow people to verify that the packages were actually built on GH Actions and with the content of the corresponding commit. This will help with supply chain security. For this to work, the `id-token` permission was added only where necessary. [0]: https://docs.npmjs.com/generating-provenance-statements
1 parent 000b61b commit f8d4307

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/release-insiders.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches: [main]
66

7+
permissions:
8+
contents: read
9+
id-token: write
10+
711
jobs:
812
build:
913
runs-on: ubuntu-latest
@@ -45,6 +49,6 @@ jobs:
4549
run: npm version 0.0.0-insiders.${{ env.SHA_SHORT }} --force --no-git-tag-version
4650

4751
- name: Publish
48-
run: npm publish --tag insiders
52+
run: npm publish --provenance --tag insiders
4953
env:
5054
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
id-token: write
910

1011
jobs:
1112
build:
@@ -44,6 +45,6 @@ jobs:
4445
echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
4546
4647
- name: Publish
47-
run: npm publish --tag ${{ env.RELEASE_CHANNEL }}
48+
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
4849
env:
4950
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)