@@ -38,7 +38,7 @@ public function open(Repository $repository, string $title, string $body, array
3838 ];
3939
4040 $ issueNumber = null ;
41- $ existingIssues = $ this ->searchApi ->issues (sprintf ('repo:%s "%s" is:open author:%s ' , $ repository ->getFullName (), $ title , $ this ->botUsername ));
41+ $ existingIssues = $ this ->searchApi ->issues (sprintf ('repo:%s "%s" is:open author:%s ' , $ repository ->getFullName (), $ title , $ this ->botUsername ), ' updated ' , ' desc ' , [ ' per_page ' => 100 ] );
4242 foreach ($ existingIssues ['items ' ] ?? [] as $ issue ) {
4343 $ issueNumber = $ issue ['number ' ];
4444 }
@@ -53,7 +53,7 @@ public function open(Repository $repository, string $title, string $body, array
5353
5454 public function lastCommentWasMadeByBot (Repository $ repository , $ number ): bool
5555 {
56- $ allComments = $ this ->issueCommentApi ->all ($ repository ->getVendor (), $ repository ->getName (), $ number );
56+ $ allComments = $ this ->issueCommentApi ->all ($ repository ->getVendor (), $ repository ->getName (), $ number, [ ' per_page ' => 100 ] );
5757 $ lastComment = $ allComments [count ($ allComments ) - 1 ] ?? [];
5858
5959 return $ this ->botUsername === ($ lastComment ['user ' ]['login ' ] ?? null );
@@ -74,7 +74,7 @@ public function hasActivity(Repository $repository, $number): bool
7474 $ reviewComments = [];
7575 }
7676
77- $ all = array_merge ($ reviewComments , $ this ->issueCommentApi ->all ($ repository ->getVendor (), $ repository ->getName (), $ number ));
77+ $ all = array_merge ($ reviewComments , $ this ->issueCommentApi ->all ($ repository ->getVendor (), $ repository ->getName (), $ number, [ ' per_page ' => 100 ] ));
7878 foreach ($ all as $ comment ) {
7979 if (!in_array ($ comment ['user ' ]['login ' ], [$ author , $ this ->botUsername ])) {
8080 return true ;
@@ -109,7 +109,7 @@ public function commentOnIssue(Repository $repository, $issueNumber, string $com
109109
110110 public function findStaleIssues (Repository $ repository , \DateTimeImmutable $ noUpdateAfter ): array
111111 {
112- $ issues = $ this ->searchApi ->issues (sprintf ('repo:%s is:issue -label:"Keep open" is:open updated:<%s ' , $ repository ->getFullName (), $ noUpdateAfter ->format ('Y-m-d ' )));
112+ $ issues = $ this ->searchApi ->issues (sprintf ('repo:%s is:issue -label:"Keep open" is:open updated:<%s ' , $ repository ->getFullName (), $ noUpdateAfter ->format ('Y-m-d ' )), ' updated ' , ' desc ' , [ ' per_page ' => 100 ] );
113113
114114 return $ issues ['items ' ] ?? [];
115115 }
0 commit comments