-
Notifications
You must be signed in to change notification settings - Fork 636
Document how to use Go version file as a fallback for Go matrix builds #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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/). | ||||||
|
|
||||||
|
|
@@ -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 | ||||||
|
||||||
| 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 |
There was a problem hiding this comment.
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
ccoVeille marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
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".
| 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 |
Uh oh!
There was an error while loading. Please reload this page.