Skip to content

Commit 10e0c19

Browse files
authored
ci: add provenance to npm packages (#252)
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 f563336 commit 10e0c19

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/release-insiders.yml

Lines changed: 2 additions & 1 deletion
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
concurrency:
1112
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -57,6 +58,6 @@ jobs:
5758
run: npm version 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }} --force --no-git-tag-version
5859

5960
- name: Publish
60-
run: npm publish --tag ${{ env.RELEASE_CHANNEL }}
61+
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
6162
env:
6263
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
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
concurrency:
1112
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -52,6 +53,6 @@ jobs:
5253
echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
5354
5455
- name: Publish
55-
run: npm publish --tag ${{ env.RELEASE_CHANNEL }}
56+
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
5657
env:
5758
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)