MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / parseGitHubRepo

Function parseGitHubRepo

packages/cli/src/github/repo.ts:13–20  ·  view source on GitHub ↗
(originUrl: string | null)

Source from the content-addressed store, hash-verified

11 * ssh://git@github.com/owner/repo(.git).
12 */
13export function parseGitHubRepo(originUrl: string | null): GitHubRepo | null {
14 if (!originUrl) return null;
15 const match = originUrl.match(/(?:^|@|\/\/)github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
16 if (!match) return null;
17 const [, owner, repo] = match;
18 if (!owner || !repo) return null;
19 return { owner, repo };
20}
21
22export function isGitHubRemote(originUrl: string | null): boolean {
23 return parseGitHubRepo(originUrl) !== null;

Callers 5

requireRepoFunction · 0.85
isGitHubRemoteFunction · 0.85
getPullRequestFunction · 0.85
requireGitHubRepoFunction · 0.85
github.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected