Skip to content

Commit

Permalink
Fix the panic when required checks is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzcc committed Aug 8, 2023
1 parent e138a07 commit 22a4dd3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/events/vcs/github_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ func (g *GithubClient) GetCombinedStatusMinusApply(repo models.Repo, pull *githu
return false, errors.Wrap(err, "getting required status checks")
}

if required.RequiredStatusChecks == nil {
return true, nil
}

//check check suite/check run api
checksuites, _, err := g.client.Checks.ListCheckSuitesForRef(context.Background(), *pull.Head.Repo.Owner.Login, repo.Name, *pull.Head.Ref, nil)
if err != nil {
Expand Down

0 comments on commit 22a4dd3

Please sign in to comment.