MCPcopy
hub / github.com/coderamp-labs/gitingest / is_github_host

Function is_github_host

src/gitingest/utils/git_utils.py:32–47  ·  view source on GitHub ↗

Check if a URL is from a GitHub host (github.com or GitHub Enterprise). Parameters ---------- url : str The URL to check Returns ------- bool True if the URL is from a GitHub host, False otherwise

(url: str)

Source from the content-addressed store, hash-verified

30
31
32def is_github_host(url: str) -> bool:
33 """Check if a URL is from a GitHub host (github.com or GitHub Enterprise).
34
35 Parameters
36 ----------
37 url : str
38 The URL to check
39
40 Returns
41 -------
42 bool
43 True if the URL is from a GitHub host, False otherwise
44
45 """
46 hostname = urlparse(url).hostname or ""
47 return hostname.startswith("github.")
48
49
50async def run_command(*args: str) -> tuple[bytes, bytes]:

Callers 6

clone_repoFunction · 0.90
test_is_github_hostFunction · 0.90
check_repo_existsFunction · 0.85
create_git_commandFunction · 0.85
_resolve_ref_to_shaFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_is_github_hostFunction · 0.72