diff --git a/cli/packages/util/check-for-update.go b/cli/packages/util/check-for-update.go index bf66f87e4..5fbf39a1e 100644 --- a/cli/packages/util/check-for-update.go +++ b/cli/packages/util/check-for-update.go @@ -5,10 +5,11 @@ import ( "fmt" "io/ioutil" "net/http" + "errors" ) func CheckForUpdate() { - latestVersion, err := getLatestTag("infisical", "infisical") + latestVersion, err := getLatestTag("Infisical", "infisical") if err != nil { // do nothing and continue return @@ -24,6 +25,9 @@ func getLatestTag(repoOwner string, repoName string) (string, error) { if err != nil { return "", err } + if resp.StatusCode != 200 { + return "", errors.New(fmt.Sprintf("GitHub API returned status code %d", resp.StatusCode)) + } defer resp.Body.Close()