Skip to content

Commit f8c8897

Browse files
authored
Verify npm dependency signatures before builds (#1027)
CI installs the locked npm dependency tree without running lifecycle scripts, but it does not verify registry signatures or available provenance attestations. Run `npm audit signatures` after installation in both the test and checksum-update workflows, before `npm run all` executes dependency tooling. The check follows npm's registry-signature support and verifies attestations when present; it does not require every dependency to publish provenance. Related: astral-sh/ruff-action#402 adds the same signature and provenance verification. #1026 separately hardens `npm` install defaults. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
1 parent f64d32b commit f8c8897

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
cache: npm
3535
- run: |
3636
npm ci --ignore-scripts
37+
- name: Verify npm package signatures
38+
run: npm audit signatures
3739
- run: |
3840
npm run all
3941
- name: Check all jobs are in all-tests-passed.needs

‎.github/workflows/update-known-checksums.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
fi
3939
- name: Compile changes
4040
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
41-
run: npm ci --ignore-scripts && npm run all
41+
run: |
42+
npm ci --ignore-scripts
43+
npm audit signatures
44+
npm run all
4245
- name: Create Pull Request
4346
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
4447
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1

0 commit comments

Comments
 (0)