File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,19 +27,22 @@ jobs:
2727 console.log(`PR Title: ${prTitle}`);
2828
2929 const existingComment = await (async () => {
30- const iterator = github.paginate.iterator(github.rest.issues.listComments, {
31- owner,
32- repo,
33- issue_number: prNumber,
34- per_page: 100,
35- });
36- for await (const { data: comments } of iterator) {
30+ const perPage = 100;
31+ for (let page = 1; ; page += 1) {
32+ const { data: comments } = await github.rest.issues.listComments({
33+ owner,
34+ repo,
35+ issue_number: prNumber,
36+ per_page: perPage,
37+ page,
38+ });
39+
3740 const found = comments.find(
3841 (c) => c.user?.type === 'Bot' && c.body?.includes(COMMENT_MARKER),
3942 );
4043 if (found) return found;
44+ if (comments.length < perPage) return null;
4145 }
42- return null;
4346 })();
4447
4548 if (!jiraKeyRegex.test(prTitle)) {
You can’t perform that action at this time.
0 commit comments