Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ The `go-version` input supports the following syntax:
| Wildcard (minor) | `1.*` | Latest available version in the major version |
| Pre-release | `1.24.0-rc.1` | Beta/RC versions for testing upcoming releases |
| Aliases | `stable`, `oldstable` | Latest stable or previous stable release |
| Empty string | `''` | No version specified; relies on `go-version-file` when provided |

For more information about semantic versioning, see the [semver documentation](https://semver.org/).

Expand Down Expand Up @@ -383,6 +384,26 @@ For more information about semantic versioning, see the [semver documentation](h
architecture: 'x64'
```

### Matrix Testing with go-version-file fallback

You can combine go-version with go-version-file in a matrix strategy to test across latest supported Go versions, and the minimal version specified in `go.mod` of your project.

```yaml
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['stable', 'oldstable', ''] # empty string to fall back on go-version-file
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment capitalization is inconsistent with the documentation style. Looking at the "Complete Input Reference" section (lines 365-384), comments are written in sentence case without periods (e.g., "Version or version range of Go to use", "Path to go.mod..."). This comment should be revised to match that style, for example: "Empty string falls back to go-version-file".

Suggested change
go-version: ['stable', 'oldstable', ''] # empty string to fall back on go-version-file
go-version: ['stable', 'oldstable', ''] # Empty string falls back to go-version-file

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not, I'll wait for a human feedback here

steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
go-version-file: "go.mod" # this one is only used when go-version is not specified.
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment capitalization and style is inconsistent with the documentation. Looking at the "Complete Input Reference" section (lines 365-384), comments are written in sentence case without periods and lowercase for field names. This should be revised to match, for example: "Used only when go-version is not specified" or "Fallback when go-version is not specified".

Suggested change
go-version-file: "go.mod" # this one is only used when go-version is not specified.
go-version-file: "go.mod" # used only when go-version is not specified

Copilot uses AI. Check for mistakes.
- run: go test ./...
```

## Using setup-go on GHES

setup-go comes pre-installed on GHES when Actions is enabled. For dynamic Go version downloads, the action fetches distributions from the [go-versions repository](https://github.com/actions/go-versions/) on github.com (external to your appliance).
Expand Down