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

Using volta-cli/action on GitHub Enterprise Server causes frequent rate-limits with no fallback #108

Closed
ZauberNerd opened this issue Sep 13, 2022 · 1 comment · Fixed by #111

Comments

@ZauberNerd
Copy link
Contributor

We are using this action on GitHub Enterprise Server and we're seeing frequent failures trying to get the latest volta-cli version, because we're not authenticated against GitHub.com.

For now we have pinned the volta-version to 1.0.8, but we would like to remove that pinning again, so that we will get the latest volta-cli version in the future.

I saw that the actions/setup-node action has a fallback to get the version directly from nodejs.org in case of rate-limits: https://github.com/actions/setup-node/blob/9f3a02bbd17adc05b078145bb8f676c84be77e89/src/installer.ts#L109-L129
Maybe something like that would make sense to implement in this action also.

I actually have two ideas that could solve this:

  1. check if the request got rate-limited and fall back to https://volta.sh/latest-version
  2. check if the request got rate-limited and do a HEAD request to https://github.com/volta-cli/volta/releases/latest which will redirect to the latest version

If there's interest and a suggestion on which route to take, I'd be willing to create a PR for it.

Ref: #77, #101, #97

@rwjblue
Copy link
Collaborator

rwjblue commented Sep 21, 2022

Eeck, sorry about this. The changes in #101 were about moving away from using https://volta.sh/latest-version due to issues with the same sort of rate limiting failures that you are seeing now after #101.

check if the request got rate-limited and fall back to https://volta.sh/latest-version

I'd gladly accept a PR that adds this, if you have the time.

ZauberNerd added a commit to ZauberNerd/action that referenced this issue Sep 27, 2022
The GitHub.com server returns a 403 or 429 status code in case of rate-
limiting.
This commit adds a check for those status codes and tries to fetch the
latest volta version from https://volta.sh/latest-version instead.

The implementation is somewhat analog to how setup-node is implemented:
- https://github.com/actions/setup-node/blob/9f3a02bbd17adc05b078145bb8f676c84be77e89/src/installer.ts#L109-L129

Fixes: volta-cli#108
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

Successfully merging a pull request may close this issue.

2 participants