mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 13:13:43 +00:00
Apply PR suggestions
This commit is contained in:
parent
9d73e829e4
commit
a29996aa9d
6 changed files with 148 additions and 174 deletions
10
README.md
10
README.md
|
@ -16,7 +16,7 @@ The V3 edition of the action offers:
|
|||
- Proxy support
|
||||
- Check latest version
|
||||
- Caching packages dependencies
|
||||
- stable and olstable aliases
|
||||
- stable and oldstable aliases
|
||||
- Bug Fixes (including issues around version matching and semver)
|
||||
|
||||
The action will first check the local cache for a version match. If a version is not found locally, it will pull it from the `main` branch of the [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository. On miss or failure, it will fall back to downloading directly from [go dist](https://storage.googleapis.com/golang). To change the default behavior, please use the [check-latest input](#check-latest-version).
|
||||
|
@ -99,7 +99,11 @@ steps:
|
|||
|
||||
## Using stable/oldstable aliases
|
||||
|
||||
Given the fact that Go doesn't use semver syntax ranges, and that many Go projects want to run tests based on `stable` and `oldstable` aliases, these aliases are introduced in the action as possible values of the input `go-version`. When alias `stable` is provided, and `check-latest` input is set to `true` action will get the latest stable version from the [`go-versions`](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository manifest. When `check-latest` is not provided, or set to false, the action will resolve `stable` as the most recent present version from the runners tool cache directory. In case of the `oldstable` alias, if current release is 1.19.x, action will resolve version as 1.18.x, where x is the latest patch release. The `check-latest` rules described above will apply for `oldstable` as well.
|
||||
If `stable` is provided, action will get the latest stable version from the [`go-versions`](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository manifest.
|
||||
|
||||
If `oldstable` is provided, when current release is 1.19.x, action will resolve version as 1.18.x, where x is the latest patch release.
|
||||
|
||||
**Note:** using these aliases will result in same version as using corresponding minor release with `check-latest` input set to `true`
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
|
@ -107,7 +111,6 @@ steps:
|
|||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 'stable'
|
||||
check-latest: true
|
||||
- run: go run hello.go
|
||||
```
|
||||
|
||||
|
@ -117,7 +120,6 @@ steps:
|
|||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 'oldstable'
|
||||
check-latest: true
|
||||
- run: go run hello.go
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue