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)
| 30 | |
| 31 | |
| 32 | def 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 | |
| 50 | async def run_command(*args: str) -> tuple[bytes, bytes]: |
no outgoing calls