Skip update check if github returns non-200

This commit is contained in:
kimcore
2023-01-28 23:06:37 +09:00
parent e6068a6f7f
commit 6eb81802c3

View File

@@ -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()