MCPcopy Index your code
hub / github.com/cli/cli / ValidateSupportedHost

Function ValidateSupportedHost

internal/skills/source/source.go:56–68  ·  view source on GitHub ↗

ValidateSupportedHost rejects hosts that are not supported. Supported hosts are github.com and GHEC with data residency (*.ghe.com). GitHub Enterprise Server is not currently supported.

(host string)

Source from the content-addressed store, hash-verified

54// Supported hosts are github.com and GHEC with data residency (*.ghe.com).
55// GitHub Enterprise Server is not currently supported.
56func ValidateSupportedHost(host string) error {
57 host = normalizeHost(host)
58 if host == "" {
59 return fmt.Errorf("could not determine repository host")
60 }
61 if host == SupportedHost || ghauth.IsTenancy(host) {
62 return nil
63 }
64 if ghauth.IsEnterprise(host) {
65 return fmt.Errorf("GitHub Skills does not currently support GitHub Enterprise Server; got %s", host)
66 }
67 return fmt.Errorf("unsupported host for GitHub Skills: %s", host)
68}
69
70func normalizeHost(host string) string {
71 host = strings.TrimSpace(strings.ToLower(host))

Callers 7

searchRunFunction · 0.92
parseInstalledSkillFunction · 0.92
installRunFunction · 0.92
previewRunFunction · 0.92
publishRunFunction · 0.92
parseGitHubURLFunction · 0.92

Calls 2

normalizeHostFunction · 0.85
ErrorfMethod · 0.65

Tested by 1