Repository navigation
Add support for pinning tools to a checksum - #1098
Merged
shivammathur merged 1 commit intoJul 23, 2026
Merged
shivammathur merged 1 commit into
shivammathur merged 1 commit into
Conversation
Tools in the tools input can now be pinned to a checksum using the tool:version@sha256:<hash> or tool:version@sha512:<hash> syntax. The downloaded tool is verified against the checksum on all platforms, including when it is served from the tools cache, and it is removed along with its cache entry if the verification fails. Checksum verification is supported for tools downloaded as phar archives. Specifying a checksum for tools set up using composer packages or custom package scripts results in an error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1098 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 906 935 +29
Branches 318 328 +10
=========================================
+ Hits 906 935 +29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shivammathur
approved these changes
Jul 23, 2026
shivammathur
pushed a commit
that referenced
this pull request
Jul 23, 2026
Tools in the tools input can now be pinned to a checksum using the tool:version@sha256:<hash> or tool:version@sha512:<hash> syntax. The downloaded tool is verified against the checksum on all platforms, including when it is served from the tools cache, and it is removed along with its cache entry if the verification fails. Checksum verification is supported for tools downloaded as phar archives. Specifying a checksum for tools set up using composer packages or custom package scripts results in an error. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This branch was previously 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.
Related discussion: None yet — happy to open one if the maintainers prefer.
Description
This PR adds opt-in checksum verification for the
toolsinput to harden workflows against supply-chain attacks (e.g. a release artifact being replaced after a tag is moved, or a fallback download source being compromised).A tool can now be pinned in a Docker-digest-like format:
Behaviour:
sha256andsha512.✗log entry (fails the job underfail-fast, and always forcomposer, matching the existing failure semantics).Implementation notes:
src/tools.tsparses and validates the@sha256:/@sha512:suffix and appends the checksum to the generatedadd_tool/Add-Toolinvocation. The shell functions detect the checksum argument by itsshaN:prefix, so existing argument positions and behaviour are unchanged.verify_checksuminsrc/scripts/unix.shusessha256sum/sha512sum,shasumoropenssl, whichever is available; Windows usesGet-FileHash.composer.phar2.9.8 as published on getcomposer.org.npm run formatbefore the commit.npm run lintbefore the commit.npm run releasebefore the commit.npm testreturns with no unit test errors and all code covered.🤖 Generated with Claude Code