Repository navigation
ci(pre-commit): install Trivy from the pinned, checksummed release tarball - #128
Conversation
…rball install.sh made a second, unretried download that failed on runner DNS blips (curl exit 6). Fetch the v0.69.3 tarball with retries, verify its pinned sha256, then unpack. Same step as LeanerCloud/cloud-commitments-go#669. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
cristim
left a comment
There was a problem hiding this comment.
APPROVE @ cc7bf90
Cold review (claude-autospotting). CI-only change to .github/workflows/pre-commit.yml (+11/-17), a line-for-line port of LeanerCloud/cloud-commitments-go#669's Trivy install step. No findings.
Checked:
- Checksum.
TRIVY_SHA256(1816b632...c88b75) equals thetrivy_0.69.3_Linux-64bit.tar.gzline in the official aquasecurity/trivy v0.69.3trivy_0.69.3_checksums.txt, which I verified independently for go#669. The asset URL built from${TRIVY_VERSION#v}names that same file. - Fails loudly.
- The step runs under
set -euo pipefail. curl -fwith--retry 5 --retry-all-errorsstill exits non-zero once retries run out.sha256sum -cruns beforetar, andtar ... trivyplustrivy --versionfail on a missing or broken binary.- The
trivy-confighook in.pre-commit-config.yamlkeeps--exit-code 1with no skip fallback, and the workflow has nocontinue-on-error.
- The step runs under
- Supply chain. Every
uses:in the workflow is pinned to a full commit SHA (checkout, setup-python, setup-go, setup-node, cache x3, nick-fields/retry). Thecurl | shinstall.sh path is removed. - CI at this head is all green. In run 41764058216, the "Run pre-commit hooks" log shows
trivy.tgz: OK,Version: 0.69.3andTrivy config scanner....Passed.
This also fixes the install.sh DNS flake (curl exit 6) that made #127's pre-commit job fail at 6e14495.
|
Independent review (claude-fleet, cold): APPROVE cc7bf90 I reviewed this cold at cc7bf90 (base d455ccb), treating the PR body and the step comment as claims. CI is green at this SHA, including "Run pre-commit hooks", the job that runs this step. Checked
Non-blocking
Not merging. |
Summary
The
Run pre-commit hooksjob fails onInstall Trivywith curl exit 6 (DNS):install.shmakes a second download with no retry. This replaces it with the step cloud-commitments-go merged in LeanerCloud/cloud-commitments-go#669, line for line:v0.69.3Linux tarball withcurl --retry 5 --retry-all-errors --retry-delay 5;checksums.txt;trivyinto/usr/local/binand print its version.The installer script is no longer executed at all, so the pin now covers the binary's bytes, not just the tag.
Verification
This PR's own
Run pre-commit hooksjob exercises the new step. It unblocks #127, whose pre-commit check fails on the same DNS error.🤖 Generated with Claude Code