feat: fallback to "raw" endpoint for manifest when rate limit is reached #496
+100
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR leverages the raw endpoint (https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json) to retrieve the golang manifest as a fallback mechanism. This allows GitHub Actions Runners, which have no API token and exceed the anonymous rate limit of 60 requests/hour/IP to still retrieve the manifest list without needing credentials.
This is especially helpful for GitHub Enterprise Server and self-hosted runners, as there multiple runners might share the same IP-address and quickly exceed the available rate limit. Supplying an access token for github.com is cumbersome, as it requires another technical user and the secret isn't exposed to forks, preventing builds from forks.
The implementation as a fallback mechanism minimizes the risk of breaking current workflows, as they will still use the normal API to retrieve the manifest.
Related issue:
This is similar to the implementation setup-python uses:
Check list:
I have tested this on our GitHub Enterprise Server with success: