(cfg gh.Config)
| 492 | } |
| 493 | |
| 494 | func mightBeGHESUser(cfg gh.Config) bool { |
| 495 | if os.Getenv("GH_ENTERPRISE_TOKEN") != "" || os.Getenv("GITHUB_ENTERPRISE_TOKEN") != "" { |
| 496 | return true |
| 497 | } |
| 498 | |
| 499 | if host := os.Getenv("GH_HOST"); host != "" && ghauth.IsEnterprise(host) { |
| 500 | return true |
| 501 | } |
| 502 | |
| 503 | // If any targeted host is Enterprise, then the user is likely a GHES user. |
| 504 | return slices.ContainsFunc(cfg.Authentication().Hosts(), func(host string) bool { |
| 505 | return ghauth.IsEnterprise(host) |
| 506 | }) |
| 507 | } |