(cfg gh.Config)
| 520 | } |
| 521 | |
| 522 | func mightBeGHESUser(cfg gh.Config) bool { |
| 523 | if os.Getenv("GH_ENTERPRISE_TOKEN") != "" || os.Getenv("GITHUB_ENTERPRISE_TOKEN") != "" { |
| 524 | return true |
| 525 | } |
| 526 | |
| 527 | if host := os.Getenv("GH_HOST"); host != "" && ghauth.IsEnterprise(host) { |
| 528 | return true |
| 529 | } |
| 530 | |
| 531 | // If any targeted host is Enterprise, then the user is likely a GHES user. |
| 532 | return slices.ContainsFunc(cfg.Authentication().Hosts(), func(host string) bool { |
| 533 | return ghauth.IsEnterprise(host) |
| 534 | }) |
| 535 | } |