mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 17:28:26 +00:00
Merge pull request #269 from kimcore/main
Skip update check if github returns non-200
This commit is contained in:
@@ -5,10 +5,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CheckForUpdate() {
|
func CheckForUpdate() {
|
||||||
latestVersion, err := getLatestTag("infisical", "infisical")
|
latestVersion, err := getLatestTag("Infisical", "infisical")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// do nothing and continue
|
// do nothing and continue
|
||||||
return
|
return
|
||||||
@@ -24,6 +25,9 @@ func getLatestTag(repoOwner string, repoName string) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return "", errors.New(fmt.Sprintf("GitHub API returned status code %d", resp.StatusCode))
|
||||||
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user