This commit is contained in:
RaeCheol Park 2026-08-20 10:22:52 +09:00 committed by GitHub
commit 6a935c3b74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 67 additions and 1 deletions

View file

@ -168,6 +168,18 @@ jobs:
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used. The `.tool-versions` file supports version specifications in accordance with asdf standards, adhering to Semantic Versioning ([semver](https://semver.org)).
### Automatic go.mod detection
If neither `go-version` nor `go-version-file` is specified, the action will automatically look for a `go.mod` file in the repository root and use the Go version specified in it. This simplifies workflows for projects that already have a `go.mod` file.
```yaml
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
# Automatically uses go.mod from repository root
- run: go version
```
```yaml
steps:
- uses: actions/checkout@v7