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

View File

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