Skip to content

Commit

Permalink
Try pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Nov 26, 2020
1 parent 3149848 commit 21e2ef8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ jobs:
});
return Object.values(latestByUser);
}
const {data: fetchedReviews} = await github.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullRequest.number,
});
github.paginate(
github.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullRequest.number,
})
.then((reviews) => {
const fetchedReviews = reviews;
}
);
const countFetched = fetchedReviews.length;
const latestFetched = fetchedReviews[fetchedReviews.length - 1];
console.log(`Fetched ${countFetched} reviews, latest is:\n${JSON.stringify(latestFetched)}`);
Expand Down

0 comments on commit 21e2ef8

Please sign in to comment.