Skip to content

Commit

Permalink
ci: update pull request ci check
Browse files Browse the repository at this point in the history
  • Loading branch information
fiamma-builder committed Nov 15, 2024
1 parent 2306cac commit 5f0df1c
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/check-existing-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,33 @@ jobs:
}
}
console.log('Fetching open PRs...');
const { data: prs } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
console.log(`Found ${prs.length} open PRs`);
// Get all open PRs with pagination
async function getAllPRs() {
let page = 1;
let allPRs = [];
while (true) {
console.log(`Fetching PRs page ${page}...`);
const { data: prs } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
per_page: 100, // Maximum allowed per page
page: page
});
if (prs.length === 0) break;
allPRs = allPRs.concat(prs);
page++;
}
return allPRs;
}
console.log('Fetching all open PRs...');
const prs = await getAllPRs();
console.log(`Found total ${prs.length} open PRs`);
for (const pr of prs) {
console.log(`\nProcessing PR #${pr.number}: ${pr.title}`);
Expand Down

0 comments on commit 5f0df1c

Please sign in to comment.