From e8c0e75e048fd216d689686daeed19157f0d5604 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 3 Jun 2022 14:39:14 +0200 Subject: [PATCH] ci: check more reviews in retest action It seems PullRequests.ListReviews() returns 30 reviews by default. This is practical for pagination, but not so much for a GitHub action. There is the rare occasion that the number of reviews if higher than 30. If that is the case, the retest action does not capture the latest reviews, which is where the APPROVED status is set. By increasing the number of results to 100 per page, we should have sufficient space for many more reviews and automated retest-ing. Signed-off-by: Niels de Vos --- actions/retest/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/retest/main.go b/actions/retest/main.go index 1111f3ed0..f019f333f 100644 --- a/actions/retest/main.go +++ b/actions/retest/main.go @@ -198,7 +198,8 @@ func main() { // checkPRRequiredApproval check PullRequest has required approvals. func (c *retestConfig) checkPRRequiredApproval(prNumber int) bool { - rev, _, err := c.client.PullRequests.ListReviews(context.TODO(), c.owner, c.repo, prNumber, &github.ListOptions{}) + opts := github.ListOptions{PerPage: 100} // defaults to 30 reviews, too few sometimes + rev, _, err := c.client.PullRequests.ListReviews(context.TODO(), c.owner, c.repo, prNumber, &opts) if err != nil { log.Printf("failed to list reviews %v\n", err) return false