Ready returns true if pull request is ready to merge
(config *config.Config)
| 77 | |
| 78 | // Ready returns true if pull request is ready to merge |
| 79 | func (pr *PullRequest) Ready(config *config.Config) bool { |
| 80 | if pr.Commit.WIP { |
| 81 | return false |
| 82 | } |
| 83 | if !pr.MergeStatus.NoConflicts { |
| 84 | return false |
| 85 | } |
| 86 | if config.Repo.RequireChecks && pr.MergeStatus.ChecksPass != CheckStatusPass { |
| 87 | return false |
| 88 | } |
| 89 | if config.Repo.RequireApproval && !pr.MergeStatus.ReviewApproved { |
| 90 | return false |
| 91 | } |
| 92 | return true |
| 93 | } |
| 94 | |
| 95 | const ( |
| 96 | // Terminal escape codes for colors |