cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Allow reuse of host checks for extension authors #152

Closed andyfeller closed 2 months ago

andyfeller commented 3 months ago

Following on the heels of #151, this commit exports the internal logic used to determine if a host is GHES deployment or a tenant.

Exporting these functions allow extension authors like github/gh-copilot to provide tailored experiences consistently with gh.

andyfeller commented 2 months ago

From @williammartin:

With the addition of normalizeHostname to IsTenancy and IsEnterprise it looks like maybe there could be a few more test cases like api.tenant.ghe.com or api.github.com or api.github.localhost