Files
ruff/.github/workflows/update-known-checksums.yml
T
f2f46687ac Verify npm dependency signatures before builds (#426)
## Summary

Supersedes #402 with its changes rebased onto current `main` and the
merge conflict resolved. The original PR is left unchanged.

- Run `npm audit signatures` after installation and before `npm run all`
in the test and checksum-update workflows.
- Preserve the current JSON checksum manifest path
(`src/download/checksum/known-checksums.json`).
- Verify registry signatures and available provenance attestations
without requiring every dependency to publish provenance.

Related: astral-sh/setup-uv#1027 adds the same verification; #401
separately hardens npm installation defaults.

## Validation

Using Node 24.19.0 (matching `.nvmrc`) and npm 11.10.0:
- `npm ci --ignore-scripts` passed (reports existing dependency
vulnerabilities; dependency files are unchanged).
- `npm audit signatures` passed: 547 registry signatures and 97
attestations verified.
- `npm run all` passed: 7 suites, 99 tests; no generated or formatting
changes.
- `actionlint` passed.
- `zizmor` reports the same 26 low-severity findings on this branch and
`main`, with no new findings.
- `git diff --check` passed.

Refs: pi-session 01a1399e-1a99-7314-9573-9a982ea1bb3f

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-14 11:05:12 +02:00

44 lines
1.4 KiB
YAML

name: "Update known checksums"
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Run every day at 4am UTC
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: npm
- name: Update known checksums
id: update-known-checksums
run:
node dist/update-known-checksums/index.cjs
src/download/checksum/known-checksums.json ${{ secrets.GITHUB_TOKEN }}
- run: |
npm ci --ignore-scripts
npm audit signatures
npm run all
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
commit-message: "chore: update known checksums"
title:
"chore: update known checksums for ${{
steps.update-known-checksums.outputs.latest-version }}"
body:
"chore: update known checksums for ${{
steps.update-known-checksums.outputs.latest-version }}"
base: main
labels: "automated-pr,update-known-checksums"
branch: update-known-checksums-pr
delete-branch: true