Skip to content

Commit

Permalink
status code update
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 22, 2024
1 parent 3b6a51f commit 0d5abfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/pkg/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ func (g *Github) VerifyGithubToken(token, orgName, repoName, commit string) erro
g.log.Error(err)
return err
}
if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden {
// on same commit, the response code is 422 which doesn't mean it is not authenticated
if resp.StatusCode != http.StatusUnauthorized ||
resp.StatusCode == http.StatusForbidden ||
resp.StatusCode == http.StatusNotFound ||
resp.StatusCode >= http.StatusInternalServerError {
err := fmt.Errorf("github auth response code is %d", resp.StatusCode)
g.log.Error(err)
return err
Expand Down

0 comments on commit 0d5abfb

Please sign in to comment.