(rootDir: string)
| 266 | } |
| 267 | |
| 268 | function detectRepo(rootDir: string): string | null { |
| 269 | // Check GitHub Actions env first |
| 270 | if (process.env.GITHUB_REPOSITORY) return process.env.GITHUB_REPOSITORY; |
| 271 | |
| 272 | // Try to extract from git remote |
| 273 | const remote = tryRunArgs(['git', 'remote', 'get-url', 'origin'], { cwd: rootDir }); |
| 274 | if (!remote) return null; |
| 275 | |
| 276 | // SSH: git@github.com:owner/repo.git |
| 277 | const sshMatch = remote.match(/github\.com[:/](.+?)(?:\.git)?$/); |
| 278 | if (sshMatch) return sshMatch[1]!; |
| 279 | |
| 280 | // HTTPS: https://github.com/owner/repo.git |
| 281 | const httpsMatch = remote.match(/github\.com\/(.+?)(?:\.git)?$/); |
| 282 | if (httpsMatch) return httpsMatch[1]!; |
| 283 | |
| 284 | return null; |
| 285 | } |
| 286 | |
| 287 | function openBrowser(url: string): void { |
| 288 | try { |
no test coverage detected
searching dependent graphs…