diff --git a/.toolbox.yaml b/.toolbox.yaml index 8e6cfe5..169025c 100644 --- a/.toolbox.yaml +++ b/.toolbox.yaml @@ -38,6 +38,7 @@ tools: github: hashicorp/terraform downloadURL: https://releases.hashicorp.com/terraform/{{ .VersionNum }}/terraform_{{ .VersionNum }}_{{ .OS }}_{{ .Arch }}.zip check: --version + version: v1.8.5 toolbox: github: bakito/toolbox check: --version diff --git a/pkg/github/client.go b/pkg/github/client.go index 39cd43d..ea62959 100644 --- a/pkg/github/client.go +++ b/pkg/github/client.go @@ -27,12 +27,13 @@ func LatestRelease(client *resty.Client, repo string, quiet bool) (*types.Github SetError(ghErr). SetHeader("Accept", "application/json") handleGithubToken(ghc, quiet) - resp, err := ghc.Get(latestReleaseURL(repo)) + url := latestReleaseURL(repo) + resp, err := ghc.Get(url) if err != nil { return nil, http.CheckError(err) } if resp.IsError() { - return nil, fmt.Errorf("github request was not successful: %s", ghErr.Message) + return nil, fmt.Errorf("github request was not successful: %s (%d) %s", url, resp.StatusCode(), ghErr.Message) } if ghr.TagName == "" { @@ -76,12 +77,13 @@ func Release(client *resty.Client, repo string, version string, quiet bool) (*ty handleGithubToken(ghc, quiet) + url := releaseURL(repo, version) resp, err := ghc.Get(releaseURL(repo, version)) if err != nil { return nil, http.CheckError(err) } if resp.IsError() { - return nil, fmt.Errorf("github request was not successful: %s", ghErr.Message) + return nil, fmt.Errorf("github request was not successful: %s (%d) %s", url, resp.StatusCode(), ghErr.Message) } if ghr.TagName == "" {