Skip to content

feat: add setup-deterministic-zip with pinned, checksum-verified install#91

Closed
nathanklick wants to merge 1 commit into
PandasWhoCode:mainfrom
nathanklick:fix/pin-checksum-deterministic-zip
Closed

feat: add setup-deterministic-zip with pinned, checksum-verified install#91
nathanklick wants to merge 1 commit into
PandasWhoCode:mainfrom
nathanklick:fix/pin-checksum-deterministic-zip

Conversation

@nathanklick

Copy link
Copy Markdown
Collaborator

Summary

Adds an opt-in setup-deterministic-zip installer that fetches timo-reymann/deterministic-zip at a pinned version (1.2.0) and verifies the release asset against a hard-coded per-platform SHA-256 before installing it, failing closed on mismatch. It follows the same pattern as the existing pinned+checksummed setup-jq, setup-gomplate, and setup-semver steps.

Why

Consumers currently install deterministic-zip inline with an unpinned, unverified pattern:

sudo curl -L -o /usr/local/bin/deterministic-zip \
  https://github.com/timo-reymann/deterministic-zip/releases/download/1.2.0/deterministic-zip_linux-amd64
sudo chmod -v +x /usr/local/bin/deterministic-zip
deterministic-zip --version

A mutable release tag with no integrity check means an upstream asset swap silently executes attacker-controlled code in the release path. This mirrors the semver supply-chain issue fixed in #90 / v1.2.2; this change lets consumers drop the inline curl | sudo install and opt in with setup-deterministic-zip: 'true' instead.

Design note

The release ships its own <asset>.sha256 sidecars, but those are not trusted here — a release-asset swap would replace the sidecar alongside the binary. The expected digests are hard-coded (as semver does), so any tamper fails closed. Supports Linux/macOS on amd64/arm64; bump instructions are in the step's env comment.

Verification

Digests baked in were reproduced from the 1.2.0 release assets, e.g. deterministic-zip_linux-amd6456e9c2e28c9f535f100df1a94df122b62f4f2f66300abde2cf68d6a236ee5eaa. A one-byte tamper changes the digest and shasum -a 256 -c - exits non-zero, aborting the step before install.

README updated with the new input and a usage note.

Copilot AI review requested due to automatic review settings July 16, 2026 01:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new opt-in installer step to this composite action for timo-reymann/deterministic-zip, using a pinned version and hard-coded per-platform SHA-256 verification (fail-closed) prior to installation—aligning with the repo’s existing “pinned + checksummed install” approach for other tools.

Changes:

  • Add a new setup-deterministic-zip input to toggle installation.
  • Implement a pinned deterministic-zip download + hard-coded SHA-256 verification + install to /usr/local/bin.
  • Document the new input and usage example in the README.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Documents the new setup-deterministic-zip input and adds a usage example.
action.yml Adds the new input and implements the pinned, checksum-verified deterministic-zip installation step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add an opt-in setup-deterministic-zip installer that fetches
timo-reymann/deterministic-zip at a pinned version (1.2.0) and verifies
the release asset against a hard-coded per-platform SHA-256 before
installing it, failing closed on mismatch. The release's own .sha256
sidecars are intentionally not trusted, since an upstream asset swap
would replace them alongside the binary.

Mirrors the existing pinned+checksummed jq/gomplate/semver steps.
Consumers can drop inline, unverified 'curl | sudo install' patterns.

Signed-off-by: Nathan Klick <nathan@theklickfamily.com>
@nathanklick

Copy link
Copy Markdown
Collaborator Author

Superseded by #92, which opens the same GPG-signed commit directly on upstream instead of from a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants