Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback to un-ratelimited "raw" endpoint for getManifestFromRepo #1801

Open
Shegox opened this issue Aug 21, 2024 · 0 comments
Open

fallback to un-ratelimited "raw" endpoint for getManifestFromRepo #1801

Shegox opened this issue Aug 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Shegox
Copy link

Shegox commented Aug 21, 2024

The getManifestFromRepo function is utilized by several downstream actions such as setup-python and setup-go to download version manifests from a GitHub repository. However, when these Actions are run on GitHub Enterprise Server, the retrieval process counts against a 60 requests/hour/IP address rate limit imposed by GitHub.com. This limit is quickly exhausted if multiple runners share a single IP address.

Currently, the recommended solution is to manually add a GitHub.com access token to each action, which increases the rate limit. However, managing this at scale is cumbersome and impractical, particularly for Pull Requests from forks.

A more effective solution would be to download the manifest via the raw endpoint (e.g., https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json). Unlike the content API, the raw endpoint does not impose rate limits, eliminating the need for an access token.

I have already implemented this approach for setup-python (see: actions/setup-python#766) and proposed it for setup-go (see: actions/setup-go#496).

To improve the overall process, I suggest making this the default behavior of the getManifestFromRepo function. It would first attempt to retrieve the manifest via the content API to maintain existing behavior, and then fallback to the raw API if it encounters an error or rate-limit.

I am willing to propose a Pull Request for this change if there is interest.

Code Snippet
n/a

Additional Information

For further context, see the issue discussing the rate limit challenge for setup-python: actions/setup-python#756

@Shegox Shegox added the enhancement New feature or request label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant