Add support for .tool-versions file in setup-go, update workflow (#673)

* setup go in local

* add .tool-versions file support
This commit is contained in:
priya-kinthali
2025-10-28 20:56:52 +05:30
committed by GitHub
parent 7bc60db215
commit faf52423ec
8 changed files with 63 additions and 14 deletions

View File

@@ -178,7 +178,7 @@ steps:
## Getting go version from the go.mod file
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work`
The `go-version-file` input accepts a path to a `go.mod` file, `.tool-versions` file or a `go.work`
file that contains the version of Go to be used by a project. The version taken
from thils file will be:
@@ -203,6 +203,15 @@ steps:
go-version-file: 'path/to/go.mod'
- run: go version
```
```yaml
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: '.tool-versions'
- run: go version
```
> The [.tool-versions file](https://asdf-vm.com/manage/configuration.html#tool-versions) supports version specifications in accordance with asdf standards, adhering to Semantic Versioning ([semver](https://semver.org)).
## Matrix testing