()
| 290 | }; |
| 291 | |
| 292 | export function isGhes(): boolean { |
| 293 | const ghUrl = new URL( |
| 294 | process.env['GITHUB_SERVER_URL'] || 'https://github.com' |
| 295 | ); |
| 296 | |
| 297 | const hostname = ghUrl.hostname.trimEnd().toUpperCase(); |
| 298 | const isGitHubHost = hostname === 'GITHUB.COM'; |
| 299 | const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); |
| 300 | const isLocalHost = hostname.endsWith('.LOCALHOST'); |
| 301 | |
| 302 | return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; |
| 303 | } |
| 304 | |
| 305 | export function isCacheFeatureAvailable(): boolean { |
| 306 | if (cache.isFeatureAvailable()) return true; |
no outgoing calls
no test coverage detected