Repository navigation
feat(gh-r): verify release asset checksums - #851
Open
LUX-ETVERITAS wants to merge 4 commits into
Open
LUX-ETVERITAS wants to merge 4 commits into
LUX-ETVERITAS wants to merge 4 commits into
Conversation
LUX-ETVERITAS
requested review from
alichtman,
pschmitt and
vladdoster
as code owners
November 14, 2026 02:35
This branch has not been deployed
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
Adds a
checksumice forfrom'gh-r'downloads, so a release asset can be verified before it is extracted or moved into place. Closes #292.checksumis opt-in. Existinggh-rrecipes are unchanged.Behavior
autotries per-asset sidecars (<asset>.sha256,.sha256sum,.sha512,.sha512sum) and common manifests (SHA256SUMS,SHA256SUMS.txt,sha256sum.txt,sha256sums.txt,checksums.txt,checksums-sha256.txt).hash file,hash *file), BSD (SHA256 (file) = hash),file: hash, filename-first, and hash-only sidecars, including CRLF.autofails closed: if no checksum file, or no entry for the selected asset, is found, the install/update is aborted.mv/ hooks.zinit update: the ice is persisted in._zinit/checksumlike other ices.zinit updatenow returns a non-zero status when the gh-r setup step fails (previously the error was printed but the update still returned 0).Implementation
zinit.zsh: registerchecksuminZINIT[ice-list]and validate its value at parse time.zinit-install.zsh: addsha256/sha512digest helpers, checksum-file parsers,autodiscovery, and the verification call in the gh-r download loop.zinit-autoload.zsh: propagate gh-r setup failures fromzinit update.sha256sum/sha512sum,shasum,openssl dgst,sha256/sha512, andcertutil.Tests
Run on Linux x86_64:
zunit run tests/checksum.zunit— 24/24 passedzunit run 'tests/gh-r.zunit@checksum sidecar with gh-r'— passedzunit run 'tests/gh-r.zunit@checksum manifest with gh-r'— passed (covers install, successful update, and failed update)zunit run tests/ice-validation.zunit— 43/43 passedzunit run tests/commands.zunit— 18/18 passedzunit run tests/ices.zunit— 28/28 passedzunit run tests/annexes.zunit— 11/11 passedmarkdownlintonREADME.md— passedzsh -nandzcompileon the modified.zshfiles — passedThe new
checksumtest file is added to the CI matrix, so macOS/Ubuntu coverage will run in CI.Security note
The checksum is fetched from the same release. This detects corrupted downloads and wrong-asset selection, but not a compromised upstream account. GPG signature verification (
.sig/.asc) is intentionally left for a follow-up because it needs an isolated keyring and an explicit key-source policy.Related
gh-rcan validate checksums #292