GitHub Actions setup-go fails to find a Go version; quoted spec reveals the cause

A GitHub Actions setup-go step can fail with an error that a requested Go version cannot be found in the published download index. The error message quotes the version spec the action searched for, and that quoted text is often different from what the workflow author intended. Three patterns usually explain the failure: a plausible version with no build for that platform and architecture, a version that came from a file rather than the workflow, or an entire file's contents treated as a version string. The article attributes the last pattern to go-version-file pointing at a file whose name the action does not recognise, since only go.mod, go.work and .tool-versions are parsed by exact basename. It also notes that a toolchain directive in go.mod can silently pin an unresolvable patch version, and that builds are matched per platform and architecture rather than per release.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in