Skip to content

Commit

Permalink
Merge pull request #50 from kevincobain2000/feature/chvers
Browse files Browse the repository at this point in the history
fix: request to gobrew tags when upgrade
  • Loading branch information
kevincobain2000 committed Aug 10, 2022
2 parents f09d559 + 4e716cb commit 3c7a7c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gobrew.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,17 @@ func (gb *GoBrew) getGithubTags(repo string) (result []string) {

githubTags = make(map[string][]string, 0)
client := &http.Client{}
request, err := http.NewRequest("GET", goBrewTagsApi, nil)
url := "https://api.github.com/repos/kevincobain2000/gobrew/git/refs/tags"
if repo == "golang/go" {
url = goBrewTagsApi
}
request, err := http.NewRequest("GET", url, nil)
if err != nil {
utils.Errorf("[Error] Cannot create request: %s", err)
return
}

request.Header.Set("User-Agent", "gobrew")
if os.Getenv("GITHUB_TOKEN") != "" {
request.Header.Set("Authorization", "token "+os.Getenv("GITHUB_TOKEN"))
}

response, err := client.Do(request)
if err != nil {
Expand Down

0 comments on commit 3c7a7c7

Please sign in to comment.