Add "review required" notice to PRs if applicable

This commit is contained in:
Mislav Marohnić 2019-11-15 12:05:05 +01:00
parent 6e894a0eab
commit be55f81e16
2 changed files with 5 additions and 0 deletions

View file

@ -51,6 +51,7 @@ func (pr PullRequest) HeadLabel() string {
type PullRequestReviewStatus struct {
ChangesRequested bool
Approved bool
ReviewRequired bool
}
func (pr *PullRequest) ReviewStatus() PullRequestReviewStatus {
@ -60,6 +61,8 @@ func (pr *PullRequest) ReviewStatus() PullRequestReviewStatus {
status.ChangesRequested = true
case "APPROVED":
status.Approved = true
case "REVIEW_REQUIRED":
status.ReviewRequired = true
}
return status
}

View file

@ -275,6 +275,8 @@ func printPrs(prs ...api.PullRequest) {
if reviews.ChangesRequested {
fmt.Printf(" - %s", utils.Red("changes requested"))
} else if reviews.ReviewRequired {
fmt.Printf(" - %s", utils.Yellow("review required"))
} else if reviews.Approved {
fmt.Printf(" - %s", utils.Green("approved"))
}