From 5ea186e07742007e3930bc2c35f218c4d430724c Mon Sep 17 00:00:00 2001 From: Pulkit Kathuria Date: Mon, 22 Jan 2024 12:03:02 +0900 Subject: [PATCH] only check 401 --- app/pkg/github.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/pkg/github.go b/app/pkg/github.go index c4993ce..114c0a4 100644 --- a/app/pkg/github.go +++ b/app/pkg/github.go @@ -69,11 +69,12 @@ func (g *Github) VerifyGithubToken(token, orgName, repoName, commit string) erro g.log.Error(err) return err } - if resp.StatusCode < 200 || resp.StatusCode > 299 { + if resp.StatusCode != http.StatusUnauthorized { err := fmt.Errorf("github auth response code is %d", resp.StatusCode) g.log.Error(err) return err } + g.log.Info("github auth response code is " + resp.Status) err = g.cache.Set(cacheKey, []byte("true"), 60*60*24*7) return err