Merge pull request #95 from Dokploy/93-bugincomplete-listing-of-github-repo-branches-in-project

fix(#93): extract all branches from repository
This commit is contained in:
Mauricio Siu 2024-05-18 15:23:21 -06:00 committed by GitHub
commit 654fe75c07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,11 +152,18 @@ export const adminRouter = createTRPCRouter({
installationId: admin.githubInstallationId,
},
});
const branches = await octokit.rest.repos.listBranches({
const branches = (await octokit.paginate(
octokit.rest.repos.listBranches,
{
owner: input.owner,
repo: input.repo,
});
return branches.data;
},
)) as unknown as Awaited<
ReturnType<typeof octokit.rest.repos.listBranches>
>["data"];
return branches;
}),
haveGithubConfigured: protectedProcedure.query(async () => {
const adminResponse = await findAdmin();