diff --git a/repositories/github.go b/repositories/github.go index f03fd6a3..0d020670 100644 --- a/repositories/github.go +++ b/repositories/github.go @@ -52,7 +52,11 @@ func (gh *GitHubRepo) getFilteredVersions(bazeliskHome, bazelFork string, wantPr } url := fmt.Sprintf("https://api.github.com/repos/%s/bazel/releases", bazelFork) - releasesJSON, err := httputil.MaybeDownload(bazeliskHome, url, bazelFork+"-releases.json", "list of Bazel releases from github.com/"+bazelFork, fmt.Sprintf("token %s", gh.token), merger) + auth := "" + if gh.token != "" { + auth = fmt.Sprintf("token %s", gh.token) + } + releasesJSON, err := httputil.MaybeDownload(bazeliskHome, url, bazelFork+"-releases.json", "list of Bazel releases from github.com/"+bazelFork, auth, merger) if err != nil { return []string{}, fmt.Errorf("unable to determine '%s' releases: %v", bazelFork, err) }