Skip to content

Commit

Permalink
fix: update octokit method namespace
Browse files Browse the repository at this point in the history
Refactored to use `octokit.rest` namespace for paginate methods.
  • Loading branch information
gentlementlegen committed Oct 29, 2024
1 parent 16ba3a8 commit 3d760e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
}
Expand All @@ -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,
Expand Down

0 comments on commit 3d760e3

Please sign in to comment.