Repository navigation
Add support for GitHub auth token - #62
Merged
Merged
Conversation
Closed
keith
commented
May 29, 2019
| } | ||
|
|
||
| if token != "" { | ||
| req.Header.Set("Authorization", "token "+token) |
Member
Author
There was a problem hiding this comment.
This logic might be a bit too GitHub specific, if so I'm open to trying to break it up
| } | ||
|
|
||
| // We could also use go-github here, but I can't get it to build with Bazel's rules_go and it pulls in a lot of dependencies. | ||
| body, err := readRemoteFile(url) |
Member
Author
There was a problem hiding this comment.
By doing this I've taken over maybeDownload, I'm happy to rename it if that makes sense.
philwo
approved these changes
May 29, 2019
philwo
left a comment
Member
There was a problem hiding this comment.
Thanks @keith! I think this is fine.
By the way, we're also working on a different mechanism to fetch the available releases by querying the contents of the GCS bucket that Bazelisk is downloading Bazel from. This would make it completely independent of GitHub.
It would also be a first step to allowing people to override the download location, so that companies could use their own mirror.
This adds support for BAZELISK_GITHUB_TOKEN which is a GitHub token used for API requests when it is set. This fixes the issue of being on a shared network and getting rate limited when using bazelisk. Fixes #18
Member
Author
|
Sounds great, at that point we could delete this |
philwo
approved these changes
Jun 4, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds support for BAZELISK_GITHUB_TOKEN which is a GitHub token used
for API requests when it is set. This fixes the issue of being on a
shared network and getting rate limited when using bazelisk.
Fixes #18