Skip to content

Commit

Permalink
only check 401
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 22, 2024
1 parent b8b4655 commit 5ea186e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/pkg/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ea186e

Please sign in to comment.