fix(#93): extract all branches from repository

This commit is contained in:
Mauricio Siu 2024-05-18 15:15:50 -06:00
parent d539b80ef7
commit a673f07430

View File

@ -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<typeof octokit.rest.repos.listBranches>
>["data"];
return branches;
}),
haveGithubConfigured: protectedProcedure.query(async () => {
const adminResponse = await findAdmin();