diff --git a/packages/backend/src/service.ts b/packages/backend/src/service.ts index bfee7702..c87f125c 100644 --- a/packages/backend/src/service.ts +++ b/packages/backend/src/service.ts @@ -202,6 +202,7 @@ export class Service { subOrgId: params.subOrgId, ethAddress: params.ethAddress, isVerified: true, + turnkeyWalletId: params.turnkeyWalletId, }); await this.db.addUserOrganization({ diff --git a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx index 6bef4562..a044944f 100644 --- a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx +++ b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx @@ -64,9 +64,16 @@ const CreateRepo = () => { 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!, { name: `${gitRepo.data.owner!.login}-${gitRepo.data.name}`, - prodBranch: gitRepo.data.default_branch ?? 'main', + prodBranch, repository: gitRepo.data.full_name, // TODO: Set selected template template: 'webapp',