MCPcopy Create free account
hub / github.com/cli/cli / expandToGitHubURL

Function expandToGitHubURL

pkg/cmd/attestation/verify/policy.go:18–23  ·  view source on GitHub ↗
(tenant, ownerOrRepo string)

Source from the content-addressed store, hash-verified

16const hostRegex = `^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+.*$`
17
18func expandToGitHubURL(tenant, ownerOrRepo string) string {
19 if tenant == "" {
20 return fmt.Sprintf("https://github.com/%s", ownerOrRepo)
21 }
22 return fmt.Sprintf("https://%s.ghe.com/%s", tenant, ownerOrRepo)
23}
24
25func expandToGitHubURLRegex(tenant, ownerOrRepo string) string {
26 url := expandToGitHubURL(tenant, ownerOrRepo)

Callers 2

expandToGitHubURLRegexFunction · 0.85
newEnforcementCriteriaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected