chore: add check-latest to setup-go for reliable Go version resolution - #529
Merged
Conversation
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.
johnstcn
approved these changes
Jul 16, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Our CI workflows use
go-version: "1.26"withactions/setup-go@v6, which is intended to resolve to the latest Go 1.26.x patch. However,setup-godefaults tocheck-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.modrequired a patch version newer than what was cached on the runner: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: trueto allactions/setup-go@v6steps. 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:
Closes #515