From 6901a97db3823a32614df86af80f1e7fb4db2abe Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Mon, 9 Mar 2026 18:05:12 -0700 Subject: [PATCH] feat(migrate): wire GitHub PAT through to agent runner mirror call MigrateSetup now sends the PAT field to the API; create route forwards it as github_token so the agent runner can clone private repos. Made-with: Cursor --- app/api/projects/create/route.ts | 2 ++ components/project-creation/MigrateSetup.tsx | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/projects/create/route.ts b/app/api/projects/create/route.ts index 14f38e5..0a584fb 100644 --- a/app/api/projects/create/route.ts +++ b/app/api/projects/create/route.ts @@ -66,6 +66,7 @@ export async function POST(request: Request) { githubRepoId, githubRepoUrl, githubDefaultBranch, + githubToken, } = body; // Check slug uniqueness @@ -126,6 +127,7 @@ export async function POST(request: Request) { github_url: githubRepoUrl, gitea_repo: `${GITEA_ADMIN_USER}/${repoName}`, project_name: projectName, + github_token: githubToken || undefined, }), }); if (!mirrorRes.ok) { diff --git a/components/project-creation/MigrateSetup.tsx b/components/project-creation/MigrateSetup.tsx index 21ee666..60b2463 100644 --- a/components/project-creation/MigrateSetup.tsx +++ b/components/project-creation/MigrateSetup.tsx @@ -46,9 +46,8 @@ export function MigrateSetup({ workspace, onClose, onBack }: SetupProps) { slug: name.toLowerCase().replace(/[^a-z0-9]+/g, "-"), product: { name: name.trim() }, creationMode: "migration", - // Top-level fields the create route reads for the mirror flow githubRepoUrl: repoUrl.trim() || undefined, - // Preserve extra metadata for future use + githubToken: pat.trim() || undefined, sourceData: { liveUrl: liveUrl.trim() || undefined, hosting: hosting || undefined,