Repository navigation
fix: check the wheel's sha256 in install-wheel.sh - #89
Merged
Merged
Conversation
The script downloaded the wheel without checking it. It now compares the file with the sha256 digest that the GitHub API lists for the release asset, and deletes it and fails on a mismatch or when no digest is listed. The fallback without jq also matched only compact JSON, while the API returns it with a space after each colon, so it never found a wheel.
✅ Deploy Preview for cpp-linter-github-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install-wheel.sh(served ashttps://cpp-linter.github.io/install-wheel.sh) downloaded the clang-format/clang-tidy wheel without checking it.digest(sha256:…) that the GitHub API lists for each release asset. On a mismatch, or when the release lists no digest, it deletes the file and fails. Every current clang-tools-wheel release has digests on all assets.sha256sum, orshasum -a 256on macOS, and fails if neither is installed.jqonly matched compact JSON ("name":"…"), but the API returns"name": "…", so it never found a wheel. The patterns now allow the space, and the fallback also reads the digest.Testing
jqand without it (aPATHwith nojq): downloading the latest clang-format and clang-tidy wheels for linux x86_64 works and prints the checked sha256;--listworks withoutjqtoo.verify_sha256with a wrong digest deletes the file and exits 1; with no digest it exits 1.shellcheckreports the same 15 existing notes as before, none on the new lines.