Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bao Zhiyuan committed Oct 29, 2024
1 parent bf1b6b1 commit d21cf25
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,16 @@ async function getPulls() {

async function allPrs() {
const pulls: Awaited<ReturnType<typeof getPulls>>['data'] = []
let pagesRemaining = true
while (pagesRemaining) {
const res = await ghClient.request('GET /repos/{owner}/{repo}/pulls', {
state: 'closed',
owner: 'moonbitlang',
repo: 'MoonBit-Code-JAM-2024',
per_page: 100,
headers: {
'X-GitHub-Api-Version': '2022-11-28',
},
})
pulls.push(...res.data)
}
const res = await ghClient.request('GET /repos/{owner}/{repo}/pulls', {
state: 'closed',
owner: 'moonbitlang',
repo: 'MoonBit-Code-JAM-2024',
per_page: 100,
headers: {
'X-GitHub-Api-Version': '2022-11-28',
},
})
pulls.push(...res.data)
return pulls
}

Expand Down

0 comments on commit d21cf25

Please sign in to comment.