From 6eb81802c32880bd1aceae42abbbbc87e3dbce27 Mon Sep 17 00:00:00 2001 From: kimcore Date: Sat, 28 Jan 2023 23:06:37 +0900 Subject: [PATCH] Skip update check if github returns non-200 --- cli/packages/util/check-for-update.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/packages/util/check-for-update.go b/cli/packages/util/check-for-update.go index bf66f87e4..9f9daa332 100644 --- a/cli/packages/util/check-for-update.go +++ b/cli/packages/util/check-for-update.go @@ -8,7 +8,7 @@ import ( ) func CheckForUpdate() { - latestVersion, err := getLatestTag("infisical", "infisical") + latestVersion, err := getLatestTag("Infisical", "infisical") if err != nil { // do nothing and continue return @@ -24,6 +24,9 @@ func getLatestTag(repoOwner string, repoName string) (string, error) { if err != nil { return "", err } + if resp.StatusCode != 200 { + return "", fmt.Sprintf("GitHub API returned status code %d", resp.StatusCode) + } defer resp.Body.Close()