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

GitHub rate limiting can affect Stack CI #6034

Closed
mpilgrem opened this issue Jan 19, 2023 · 0 comments
Closed

GitHub rate limiting can affect Stack CI #6034

mpilgrem opened this issue Jan 19, 2023 · 0 comments

Comments

@mpilgrem
Copy link
Member

Stack makes unauthenticated requests of the GitHub REST API to access project templates in various GitHub repositories (see Stack.New.settingsFromRepoTemplatePath). GitHub limits those to 60 an hour per user. There is a much higher limit for authenticated requests (which can use 'basic' HTTP authentication), and GitHub provides the GITHUB_TOKEN secret to facilitate authentication in GitHub Actions. Recently, part of Stack's CI (integration tests on Ubuntu only) has begun to fail with rate limit exceeded.

I consider the following be an appropriate way to fix that: Stack would see if certain environment variables were present (I have in mind GH_TOKEN and then GITHUB_TOKEN like the secret - see https://cli.github.com/manual/gh_help_environment) and, if one were present, would seek to use its value to make an authenticated request.

Most users would be oblivious to this feature; not many users will be calling upon a template every minute for an hour. Stack's CI would then set the GH_TOKEN environment variable, using the secret.

mpilgrem added a commit that referenced this issue Jan 20, 2023
Fix #6034 Allow authenticated requests to GitHub REST API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant