ci: derive Go version from go.mod in setup-go#9
Merged
Aleksei Sviridkin (lexfrei) merged 1 commit intoJun 4, 2026
Conversation
The test and golangci-lint jobs pinned setup-go to go-version: stable. When the go directive in go.mod requires a patch release newer than the latest stable Go that the runner has provisioned, setup-go installs the older stable toolchain and exports GOTOOLCHAIN=local, so the build, test, and lint steps fail with go.mod requires go >= X (running go Y; GOTOOLCHAIN=local). Read the required version from go.mod with go-version-file so setup-go installs exactly the toolchain the module declares, keeping CI in lockstep with the go directive on every bump. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
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.
Pull Request
Summary
The CI Go jobs pinned
actions/setup-gotogo-version: "stable". When thegodirective ingo.modrequires a patch release newer than the latest stable Go the runner has provisioned, setup-go installs the older stable toolchain and exportsGOTOOLCHAIN=local, so the build/test/lint steps fail withgo.mod requires go >= X (running go Y; GOTOOLCHAIN=local). This is exactly what blocks the pendinggo 1.26.4directive bump, where the runner provisions1.26.3as stable.This switches the
testandgolangci-lintjobs to read the required version fromgo.modviago-version-file, so setup-go installs precisely the toolchain the module declares and CI stays in lockstep with thegodirective on every future bump.Changes
testandgolangci-lintjobs now usego-version-file: go.modinstead ofgo-version: "stable"inactions/setup-go.Testing
make test)make lint)make docsproduces no diff)make testacc), if applicablemake docsandtestaccare not applicable: this is a CI-only change with no schema, resource, or code changes.Documentation
examples/(if a resource/data source changed)make docs)Not applicable: no user-facing or resource changes.
Checklist
type(scope): description)Additional Notes
The CodeQL job is unaffected (it uses its own Go extractor) and the markdown job has no Go step, so only the two Go jobs needed the change.