feat(setup-pack): add pack-version-file input and verify download checksum#428
Draft
somaz94 wants to merge 1 commit into
Draft
feat(setup-pack): add pack-version-file input and verify download checksum#428somaz94 wants to merge 1 commit into
somaz94 wants to merge 1 commit into
Conversation
…cksum Signed-off-by: somaz <genius5711@gmail.com>
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Jun 19, 2026
Contributor
|
This sounds great! A couple of notes/questions:
This sounds backwards to me. As I read this, my understanding is that
https://github.com/actions/setup-go/blob/main/docs/advanced-usage.md#using-the-go-version-file-input
|
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.
The
setup-packaction only accepted an explicitpack-version, and it piped the downloaded archive straight intotarwith no integrity check. This adds two things:pack-version-fileinput that reads the version from a.tool-versionsfile (thepackentry) or a plain version file like.pack-version. When set it takes precedence overpack-version. The existingpack-versiondefault line is left untouched so theupdate-pack-versionautomation keeps working.<asset>.sha256, so the action now downloads the archive to a temp file, verifies it against that checksum, and only then extracts. If the checksum cannot be fetched it warns and proceeds, so mirror / air-gapped setups are not broken.Both changes are backward compatible: with neither input changed, behavior is identical except the download is now checksum verified.
Validation
Done locally (the repo has no composite-action test harness, only the Go unit tests):
.tool-versionswith apackentry (including tab separated + trailing comment), plain version file (including a leadingvand comment lines), missing-file error, and.tool-versionswithout apackentry error.v0.40.6linux asset: a matching sum passes, a corrupted archive is rejected, andtarmember extraction still yields thepackbinary.shellcheckclean on both inline scripts.