Repository navigation
Conversation
Look for GoReleaser in the runner tool cache before a download. This makes a second use of the action in the same job, or any job on a self-hosted runner, install immediately. Add an opt-in `cache-binary` input that also stores the binary in the GitHub Actions cache. When it hits, the action does not download the release archive, the checksums and the signature bundle again. Cache errors are not fatal and fall back to a download. The runner tool cache entry is now keyed by distribution, so a Pro binary is no longer returned for an OSS install of the same version. Closes #476 Co-authored-by: timbretimber <105982513+timbretimber@users.noreply.github.com> Co-authored-by: Akkuman <akkumans@qq.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Both branches called extractZip with the same destination after the install rewrite, so only the source path differs now. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4eaf86fa-a85b-41f6-8763-612acc1ccc39 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> # Conflicts: # dist/index.js
Review found that the GitHub Actions cache layer cost more than it saved. Measured on ubuntu-latest, same job, same version: cold: download + checksum + cosign + extract 0.93 s cache hit: restore the 24 MB entry 1.28 s first run also pays a save +2.26 s It is slower than a download in every configuration measured, because a GitHub-hosted runner reaches the release CDN in about 0.4 s for a 15 MB archive, and the cached entry is the larger extracted directory. It also skipped the sha256 and cosign verification on a hit, which is the control it was supposed to protect, and the only case where it wins on time is when cosign is installed, which is exactly the case where skipping is wrong. It cost 875 KB (+120%) of dist/index.js for every user and 24 MB of repository cache quota per version and platform. The restore and save wrappers were also dead code: @actions/cache catches everything except ValidationError internally, so the try/catch and the ReserveCacheError classification could never run. What remains is the runner tool cache lookup, which is what #476 asked for, and the distribution-keyed tool name that stops a Pro binary being returned for an OSS install. The tool cache test asserted that two installs return the same path, but that path is a pure function of the tool, version and architecture: it passed even with the tool cache wiped between the calls. It now asserts that the second install reports a tool cache hit and does not download, and it was verified to fail when the lookup is removed. Co-authored-by: timbretimber <105982513+timbretimber@users.noreply.github.com> Co-authored-by: Akkuman <akkumans@qq.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4eaf86fa-a85b-41f6-8763-612acc1ccc39 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
caarlos0
commented
Sep 3, 2026
caarlos0
left a comment
Member
Author
There was a problem hiding this comment.
Blocking review from GitHub Copilot. These findings can make a self-hosted runner trust binaries with less verification than the documented contract. GitHub does not allow REQUEST_CHANGES on the author account, so this review uses COMMENT, but both findings are blocking. The refreshed master also conflicts in generated dist/index.js; merge master and regenerate the bundle from the merged sources. Per request, no local build was run.
Review feedback: the paragraph explaining why the action does not use the GitHub Actions cache is not needed. The measurements stay in the pull request for anyone who asks again. Also rebuilds dist for js-yaml 5.4.1, merged from master in #578. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4eaf86fa-a85b-41f6-8763-612acc1ccc39 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> # Conflicts: # dist/index.js
Keep checksum-skipped downloads out of the persistent tool cache and separate checksum-only entries from cosign-verified entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5abc512e-338c-4459-98ea-d3606438d56a Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
caarlos0
enabled auto-merge (squash)
September 3, 2026 03:24
caarlos0
disabled auto-merge
September 3, 2026 03:31
This was referenced Sep 3, 2026
1 task
5 tasks done
1 task
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.
Makes the action reuse a GoReleaser binary it already installed, instead of downloading and verifying it again.
Closes #476.
What it does
The action already wrote to the runner tool cache, but never read from it, so every run downloaded again. It now calls
tc.find()before it downloads.A second use of the action in the same job, or any job on a self-hosted runner that already has the version, now installs immediately.
The tool cache entry is keyed by distribution (
goreleaser/goreleaser-pro) and verification level (checksum/cosign). Both parts are required:Nothing read the tool cache before this PR, so these collisions were not reachable on
master. Addingtc.find()is what makes them reachable, so the keying ships with it. Both other open PRs miss the distribution part: #528 and #510 each calltc.find('goreleaser-action', ...).What it saves
Measured on a GitHub-hosted ubuntu runner, in this repository's own
cijob, which uses the action twice:Be clear about this: a normal single-use release job on a GitHub-hosted runner gets no speed-up. The benefit is for self-hosted runners, which is what #476 asked for, and for repeated use in one job.
Why there is no GitHub Actions cache
The first version of this PR added an opt-in
cache-binaryinput backed by@actions/cache. It was measured and removed. On ubuntu-latest, same job, same version:It is slower than a download in every configuration measured. A GitHub-hosted runner reaches the release CDN in about 0.4 s for the 15 MB archive, and the cached entry is the larger extracted directory.
It was also wrong on three other counts:
dist/index.jsfor every user, and 24 MB of repository cache quota per version and platform.@actions/cachecatches everything exceptValidationErrorinternally, and logsReserveCacheErrorat info level itself, so thetry/catchand theinstanceofclassification could never run.Trust
A binary taken from the tool cache is not verified again. Cache entries record whether checksum or checksum and cosign verification completed. When cosign is available for a release with a sigstore bundle, the action only accepts a cosign-verified entry. If the checksum file cannot be downloaded, the binary can run for that invocation under the existing best-effort policy, but it is not stored in the persistent tool cache.
On a self-hosted runner the tool cache is kept between jobs, so it must be trusted like the runner itself. GitHub-hosted runners start with an empty tool cache in every job.
Tests
The first version asserted that two installs return the same path. That path is a pure function of the tool, version and architecture, so the assertion passed even with the tool cache wiped between the two calls — it could not fail.
The tests now cover:
Credits
Builds on #510 (@timbretimber) and #528 (@akkuman), both added as co-authors.