mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Use paginate
This commit is contained in:
@@ -243,12 +243,14 @@ export async function getPrForCommit(
|
||||
repo: string,
|
||||
commit: GitHubCommit,
|
||||
): Promise<AssociatedPullRequest | undefined> {
|
||||
const { data: prs } =
|
||||
await client.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||
const prs = await client.paginate(
|
||||
client.rest.repos.listPullRequestsAssociatedWithCommit,
|
||||
{
|
||||
owner,
|
||||
repo,
|
||||
commit_sha: commit.sha,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
if (prs.length === 0) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user