diff --git a/src/apm_cli/utils/github_host.py b/src/apm_cli/utils/github_host.py index c827eae88..acaa2d6b6 100644 --- a/src/apm_cli/utils/github_host.py +++ b/src/apm_cli/utils/github_host.py @@ -62,7 +62,9 @@ def is_valid_fqdn(hostname: str) -> bool: """ if not hostname: return False - + + hostname = hostname.split('/')[0] # Remove any path components + # Single regex to validate all FQDN rules: # - Starts with alphanumeric # - Labels only contain alphanumeric and hyphens diff --git a/tests/unit/test_github_host.py b/tests/unit/test_github_host.py index 258589348..f5f3207c7 100644 --- a/tests/unit/test_github_host.py +++ b/tests/unit/test_github_host.py @@ -6,6 +6,7 @@ def test_valid_fqdns(): valid_hosts = [ "github.com", + "github.com/user/repo", "example.com", "sub.example.co.uk", "a1b2.example",