(worktreePath: string)
| 73 | } |
| 74 | |
| 75 | async function getRepoUrl(worktreePath: string): Promise<string | null> { |
| 76 | try { |
| 77 | const { stdout } = await execWithShellEnv( |
| 78 | "gh", |
| 79 | ["repo", "view", "--json", "url"], |
| 80 | { cwd: worktreePath }, |
| 81 | ); |
| 82 | const raw = JSON.parse(stdout); |
| 83 | const result = GHRepoResponseSchema.safeParse(raw); |
| 84 | if (!result.success) { |
| 85 | console.error("[GitHub] Repo schema validation failed:", result.error); |
| 86 | console.error("[GitHub] Raw data:", JSON.stringify(raw, null, 2)); |
| 87 | return null; |
| 88 | } |
| 89 | return result.data.url; |
| 90 | } catch { |
| 91 | return null; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | async function getPRForBranch( |
| 96 | worktreePath: string, |
no test coverage detected