From a673f074304e6b422d180a1d36fb46ca8e1ef9f1 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 18 May 2024 15:15:50 -0600 Subject: [PATCH] fix(#93): extract all branches from repository --- server/api/routers/admin.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/server/api/routers/admin.ts b/server/api/routers/admin.ts index 44eaf6ad..124492d3 100644 --- a/server/api/routers/admin.ts +++ b/server/api/routers/admin.ts @@ -152,11 +152,18 @@ export const adminRouter = createTRPCRouter({ installationId: admin.githubInstallationId, }, }); - const branches = await octokit.rest.repos.listBranches({ - owner: input.owner, - repo: input.repo, - }); - return branches.data; + + const branches = (await octokit.paginate( + octokit.rest.repos.listBranches, + { + owner: input.owner, + repo: input.repo, + }, + )) as unknown as Awaited< + ReturnType + >["data"]; + + return branches; }), haveGithubConfigured: protectedProcedure.query(async () => { const adminResponse = await findAdmin();