Fix default branch bug

This commit is contained in:
Gilbert 2024-05-08 22:27:58 -05:00
parent c3b048d273
commit 939b1c40e8
2 changed files with 9 additions and 1 deletions

View File

@ -202,6 +202,7 @@ export class Service {
subOrgId: params.subOrgId, subOrgId: params.subOrgId,
ethAddress: params.ethAddress, ethAddress: params.ethAddress,
isVerified: true, isVerified: true,
turnkeyWalletId: params.turnkeyWalletId,
}); });
await this.db.addUserOrganization({ await this.db.addUserOrganization({

View File

@ -64,9 +64,16 @@ const CreateRepo = () => {
return; return;
} }
// Refetch to always get correct default branch
const templateRepo = await octokit.rest.repos.get({
owner: template.repoFullName.split('/')[0],
repo: template.repoFullName.split('/')[1],
});
const prodBranch = templateRepo.data.default_branch ?? 'main';
const { addProject } = await client.addProject(orgSlug!, { const { addProject } = await client.addProject(orgSlug!, {
name: `${gitRepo.data.owner!.login}-${gitRepo.data.name}`, name: `${gitRepo.data.owner!.login}-${gitRepo.data.name}`,
prodBranch: gitRepo.data.default_branch ?? 'main', prodBranch,
repository: gitRepo.data.full_name, repository: gitRepo.data.full_name,
// TODO: Set selected template // TODO: Set selected template
template: 'webapp', template: 'webapp',