fix: Set mergeable correctly when branch protection doesn't require reviewers (#2470)

* Allow no required reviewers

* Fix comment in tests

Co-authored-by: Stas Ostrovskyi <stasostrovskyi@users.noreply.github.com>
This commit is contained in:
Stas Ostrovskyi
2022-09-08 22:54:50 +02:00
committed by GitHub
parent 178e4a4c09
commit b8297bb1f8
4 changed files with 338 additions and 1 deletions

View File

@@ -365,7 +365,7 @@ func (g *GithubClient) GetPullReviewDecision(repo models.Repo, pull models.PullR
return approvalStatus, errors.Wrap(err, "getting reviewDecision")
}
if query.Repository.PullRequest.ReviewDecision == "APPROVED" {
if query.Repository.PullRequest.ReviewDecision == "APPROVED" || len(query.Repository.PullRequest.ReviewDecision) == 0 {
return true, nil
}