-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fallback to "raw" endpoint for manifest when rate limit is reac…
…hed (#496) * feat: fallback to "raw" endpoint for manifest when rate limit is reached * add information about raw access to the README * prettier * update cross-spawn to 7.0.6 to fix vulnerability
- Loading branch information
Showing
5 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,18 +242,14 @@ documentation. | |
|
||
## Using `setup-go` on GHES | ||
|
||
`setup-go` comes pre-installed on the appliance with GHES if Actions is enabled. 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). 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). If | ||
more requests are made within the time frame, then you will start to see rate-limit errors during downloading that looks | ||
like: `##[error]API rate limit exceeded for...`. After that error the action will try to download versions directly | ||
from https://storage.googleapis.com/golang, but it also can have rate limit so it's better to put token. | ||
|
||
To get a higher rate limit, you | ||
can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` | ||
input for the action: | ||
`setup-go` comes pre-installed on the appliance with GHES if Actions is enabled. | ||
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). | ||
|
||
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). | ||
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. | ||
If that fails as well the action will try to download versions directly from https://storage.googleapis.com/golang. | ||
|
||
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: | ||
|
||
```yaml | ||
uses: actions/setup-go@v5 | ||
|
@@ -262,8 +258,7 @@ with: | |
go-version: '1.18' | ||
``` | ||
|
||
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. | ||
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. | ||
See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/[email protected]/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)" | ||
for more information. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters