Skip to content

chore: add check-latest to setup-go for reliable Go version resolution - #529

Merged
denisra merged 1 commit into
mainfrom
fix/setup-go-check-latest
Jul 16, 2026
Merged

chore: add check-latest to setup-go for reliable Go version resolution#529
denisra merged 1 commit into
mainfrom
fix/setup-go-check-latest

Conversation

@denisra

@denisra denisra commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

Our CI workflows use go-version: "1.26" with actions/setup-go@v6, which is intended to resolve to the latest Go 1.26.x patch. However, setup-go defaults to check-latest: false, which means it checks the runner's local tool cache first before consulting the go-versions manifest. If a matching version exists in the cache (e.g. Go 1.26.4), it uses it immediately — even when a newer patch (e.g. 1.26.5) is available in the manifest.

This caused CI failures whenever go.mod required a patch version newer than what was cached on the runner:

Found in cache @ /opt/hostedtoolcache/go/1.26.4/x64
...
go: go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)

More broadly, this means any future Go patch bump in the 1.26.x series could break CI until the runner images are updated with the new version — defeating the purpose of using a minor-only version spec.

Fix

Adds check-latest: true to all actions/setup-go@v6 steps. This tells setup-go to always check the manifest for the latest matching version, even when a match exists in the local cache. With this change, go-version: "1.26" reliably resolves to the latest 1.26.x patch.

Confirmed working — CI now resolves to Go 1.26.5 from the manifest:

Attempting to resolve the latest version from the manifest...
matching 1.26...
Resolved as '1.26.5'

Closes #515

Adds check-latest: true to all actions/setup-go@v6 steps in CI
workflows. Without this, setup-go uses whatever Go version is in
the runner's local tool cache instead of resolving go-version: "1.26"
to the latest patch from the manifest. This prevents CI failures when
go.mod requires a newer patch than what's cached.
@denisra
denisra requested a review from johnstcn July 16, 2026 14:43
@denisra
denisra merged commit 756e3a8 into main Jul 16, 2026
16 checks passed
@denisra
denisra deleted the fix/setup-go-check-latest branch July 16, 2026 15:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update go lang from 1.26.3 to 1.26.5

2 participants