feat(image): expose default go on PATH (parity with ubuntu-latest)#24
Open
ozeranskii wants to merge 1 commit into
Open
feat(image): expose default go on PATH (parity with ubuntu-latest)#24ozeranskii wants to merge 1 commit into
ozeranskii wants to merge 1 commit into
Conversation
Go was baked into the toolcache (for setup-go offline cache hits) but never put on the default PATH, unlike ubuntu-latest which exposes its newest cached Go as the system go. Tools that assume a system go — e.g. pre-commit golang hooks (gitleaks, actionlint) — therefore tried to download a toolchain from go.dev and failed on restricted egress. Symlink the newest baked version to /usr/local/go and add /usr/local/go/bin and the GOPATH bin (/home/runner/go/bin) to PATH. GOROOT resolves into the toolcache, matching ubuntu-latest; no extra download or version pin. A smoke assertion guards that go is on PATH at the expected version.
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.
Go was baked into the toolcache (for
setup-gooffline cache hits) but never put on the default PATH — unlike ubuntu-latest, which exposes its newest cached Go as the systemgo. Tools that assume a systemgo(e.g. pre-commit golang hooks such as gitleaks and actionlint) therefore tried to download a toolchain from go.dev and failed on restricted egress./usr/local/goand add/usr/local/go/bin+ the GOPATH bin (/home/runner/go/bin) toPATH.GOROOTresolves into the toolcache, matching ubuntu-latest — no extra download, no extra version pin (follows the existingGO_126bump).gois on PATH at the expected version.Verified:
which go→/usr/local/go/bin/go,go version→ go1.26.4,GOROOT→ toolcache, andshutil.which('go')(what pre-commit checks) resolves — so it uses the system Go instead of downloading one.