Skip to content

Commit bb3e624

Browse files
committed
debug: use direct list instead of paginate and add logging
1 parent 107ddb4 commit bb3e624

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/scripts/review-sync/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,24 @@ module.exports = async ({ github, context, core }) => {
7474
return;
7575
}
7676

77-
// ── 2. Fetch all open non-draft PRs (paginated) ──────────────────────────
78-
console.log('\n--- Fetching Open PRs ---');
79-
const allPRs = await github.paginate(github.rest.pulls.list, {
77+
// ── 2. Fetch all open non-draft PRs ─────────────────────────────────────
78+
console.log(`\n--- Fetching Open PRs for ${owner}/${repo} ---`);
79+
80+
const { data: allPRs } = await github.rest.pulls.list({
8081
owner,
8182
repo,
8283
state: 'open',
8384
per_page: 100,
8485
});
8586

87+
console.log(` Successfully fetched ${allPRs.length} total open PRs.`);
88+
8689
const prs = allPRs.filter((pr) => !pr.draft);
87-
console.log(` Total open PRs: ${allPRs.length}`);
8890
console.log(` Non-draft PRs to process: ${prs.length}`);
8991
console.log(` Draft PRs skipped: ${allPRs.length - prs.length}`);
9092

9193
if (prs.length === 0) {
92-
console.log(' No non-draft PRs found. Exiting.');
94+
console.log(' No non-draft PRs found. Check if your PR is a Draft or targeting the wrong repo.');
9395
return;
9496
}
9597

0 commit comments

Comments
 (0)