MCPcopy Index your code
hub / github.com/dmno-dev/bumpy / detectRepo

Function detectRepo

packages/bumpy/src/commands/ci-setup.ts:268–285  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

266}
267
268function 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
287function openBrowser(url: string): void {
288 try {

Callers 1

ciSetupCommandFunction · 0.70

Calls 1

tryRunArgsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…