You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-15Lines changed: 10 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -193,8 +193,8 @@ steps:
193
193
194
194
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work` file that contains the version of Go to be used by a project.
195
195
196
-
The `go` directive in `go.mod` can specify a patch version or omit it altogether (e.g., `go 1.22.0` or `go 1.22`).
197
-
If a patch version is specified, that specific patch version will be used.
196
+
The `go` directive in `go.mod` can specify a patch version or omit it altogether (e.g., `go 1.22.0` or `go 1.22`).
197
+
If a patch version is specified, that specific patch version will be used.
198
198
If no patch version is specified, it will search for the latest available patch version in the cache,
199
199
[versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the
200
200
[official Go language website](https://golang.org/dl/?mode=json&include=all), in that order.
@@ -242,18 +242,14 @@ documentation.
242
242
243
243
## Using `setup-go` on GHES
244
244
245
-
`setup-go`comes pre-installed on the appliance with GHES if Actions is enabled. When dynamically downloading Go
246
-
distributions, `setup-go` downloads distributions from [`actions/go-versions`](https://github.com/actions/go-versions)
247
-
on github.com (outside of the appliance). These calls to `actions/go-versions` are made via unauthenticated requests,
248
-
which are limited
249
-
to [60 requests per hour per IP](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). If
250
-
more requests are made within the time frame, then you will start to see rate-limit errors during downloading that looks
251
-
like: `##[error]API rate limit exceeded for...`. After that error the action will try to download versions directly
252
-
from https://storage.googleapis.com/golang, but it also can have rate limit so it's better to put token.
245
+
`setup-go`comes pre-installed on the appliance with GHES if Actions is enabled.
246
+
When dynamically downloading Go distributions, `setup-go` downloads distributions from [`actions/go-versions`](https://github.com/actions/go-versions) on github.com (outside of the appliance).
253
247
254
-
To get a higher rate limit, you
255
-
can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token`
256
-
input for the action:
248
+
These calls to `actions/go-versions` are made via unauthenticated requests, which are limited to [60 requests per hour per IP](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).
249
+
If more requests are made within the time frame, then the action leverages the `raw API` to retrieve the version-manifest. This approach does not impose a rate limit and hence facilitates unrestricted consumption. This is particularly beneficial for GHES runners, which often share the same IP, to avoid the quick exhaustion of the unauthenticated rate limit.
250
+
If that fails as well the action will try to download versions directly from https://storage.googleapis.com/golang.
251
+
252
+
If that fails as well you can get a higher rate limit with [generating a personal access token on github.com](https://github.com/settings/tokens/new) and passing it as the `token` input to the action:
257
253
258
254
```yaml
259
255
uses: actions/setup-go@v5
@@ -262,8 +258,7 @@ with:
262
258
go-version: '1.18'
263
259
```
264
260
265
-
If the runner is not able to access github.com, any Go versions requested during a workflow run must come from the
266
-
runner's tool cache.
261
+
If the runner is not able to access github.com, any Go versions requested during a workflow run must come from the runner's tool cache.
267
262
See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/enterprise-server@3.2/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)"
0 commit comments