GitHub Actions actions/setup-go "Could not find a version that satisfied"
actions/setup-go cannot find a Go release matching your request. The go-version string is too specific, points at a version that does not exist, or you asked it to read a go.mod that is missing.
What this error means
The setup-go step fails with "Could not find a version that satisfied the version spec", listing the version you requested. No Go toolchain is installed, so later steps fail too.
Error: Could not find a version that satisfied the version spec: 1.99
##[error] Could not resolve the requested Go versionCommon causes
Non-existent or over-pinned version
A version like 1.99 does not exist, and an over-pinned patch (1.22.0 when only 1.22.x newer exists) may not be in the manifest. setup-go matches against published releases.
go-version-file points nowhere
Using go-version-file: go.mod requires that file to exist and declare a go directive. A missing file or absent directive leaves nothing to resolve.
How to fix it
Use a resolvable version spec or go.mod
- uses: actions/setup-go@v5
with:
go-version: '1.22' # minor spec resolves to latest patch
# or derive it from the module file
- uses: actions/setup-go@v5
with:
go-version-file: go.modPin to a published release
- Prefer a minor spec like 1.22 so it resolves to the newest patch.
- Verify the exact version exists before pinning a full patch.
- Update setup-go to the latest major to pick up newer Go releases in its manifest.
How to prevent it
- Pin go-version to a minor spec, or read it from go.mod.
- Keep setup-go on its current major so new Go releases are known.
- Avoid pinning non-existent or unreleased patch versions.