MCPcopy Create free account
hub / github.com/github/gh-aw / GetGitHubHostForRepo

Function GetGitHubHostForRepo

pkg/parser/github.go:49–58  ·  view source on GitHub ↗

GetGitHubHostForRepo returns the GitHub host URL for a specific repository. Repositories under the github, githubnext, and microsoft organizations are fetched from public GitHub (https://github.com) in cross-host contexts. microsoft/* is included because canonical shared workflows (for example micro

(owner, repo string)

Source from the content-addressed store, hash-verified

47// microsoft/apm/.github/workflows/shared/apm.md) are maintained on github.com.
48// For all other repositories, it uses GetGitHubHost().
49func GetGitHubHostForRepo(owner, repo string) string {
50 switch owner {
51 case "github", "githubnext", "microsoft":
52 githubLog.Printf("Using public GitHub host for %s/%s repository in %s organization", owner, repo, owner)
53 return string(constants.PublicGitHubHost)
54 }
55
56 // For all other repositories, use the configured GitHub host
57 return GetGitHubHost()
58}
59
60// GetGitHubToken attempts to get GitHub token from environment or gh CLI
61func GetGitHubToken() (string, error) {

Calls 2

GetGitHubHostFunction · 0.85
PrintfMethod · 0.45