From 3d760e37911f24c4d61601bc74960d742396b36b Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 30 Oct 2024 01:58:58 +0900 Subject: [PATCH] fix: update octokit method namespace Refactored to use `octokit.rest` namespace for paginate methods. --- src/utils/issue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/issue.ts b/src/utils/issue.ts index 7a70a91..c04a108 100644 --- a/src/utils/issue.ts +++ b/src/utils/issue.ts @@ -16,7 +16,7 @@ export async function getAssignedIssues(context: Context, username: string) { try { return await context.octokit - .paginate(context.octokit.search.issuesAndPullRequests, { + .paginate(context.octokit.rest.search.issuesAndPullRequests, { q: `org:${payload.repository.owner.login} assignee:${username} is:open is:issue`, per_page: 100, order: "desc", @@ -183,7 +183,7 @@ async function getAllPullRequests(context: Context, state: Endpoints["GET /repos }; try { - return (await context.octokit.paginate(context.octokit.search.issuesAndPullRequests, query)) as GitHubIssueSearch["items"]; + return (await context.octokit.paginate(context.octokit.rest.search.issuesAndPullRequests, query)) as GitHubIssueSearch["items"]; } catch (err: unknown) { throw new Error(context.logger.error("Fetching all pull requests failed!", { error: err as Error, query }).logMessage.raw); } @@ -208,7 +208,7 @@ export async function getAllPullRequestReviews(context: Context, pullNumber: num } = context; try { return ( - await context.octokit.paginate(context.octokit.pulls.listReviews, { + await context.octokit.paginate(context.octokit.rest.pulls.listReviews, { owner, repo, pull_number: pullNumber,