Skip to content

Commit 5a85d80

Browse files
authored
CI: Add provenance to publised packages (#3023)
This commit adds provenance for all published packages. See the NPM documentation [0]. Provenance will allow people to verify that the headlessui 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 79b0330 commit 5a85d80

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/release-insiders.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
99
cancel-in-progress: true
1010

11+
permissions:
12+
contents: read
13+
id-token: write
14+
1115
jobs:
1216
build:
1317
runs-on: ubuntu-latest
@@ -53,7 +57,7 @@ jobs:
5357
run: npm version -w packages 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version
5458

5559
- name: Publish
56-
run: npm publish -w packages --tag insiders
60+
run: npm publish -w packages --provenance --tag insiders
5761
env:
5862
CI: true
5963
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ concurrency:
1010

1111
permissions:
1212
contents: read
13+
id-token: write
1314

1415
env:
1516
CI: true
@@ -58,6 +59,6 @@ jobs:
5859
echo "PACKAGE_PATH=$(npm run package-path $TAG_NAME --silent)" >> $GITHUB_ENV
5960
6061
- name: Publish
61-
run: npm publish ${{ env.PACKAGE_PATH }} --tag ${{ env.RELEASE_CHANNEL }}
62+
run: npm publish ${{ env.PACKAGE_PATH }} --provenance --tag ${{ env.RELEASE_CHANNEL }}
6263
env:
6364
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)