()
| 97 | } |
| 98 | |
| 99 | export function isGhes(): boolean { |
| 100 | const ghUrl = new URL( |
| 101 | process.env['GITHUB_SERVER_URL'] || 'https://github.com' |
| 102 | ); |
| 103 | |
| 104 | const hostname = ghUrl.hostname.trimEnd().toUpperCase(); |
| 105 | const isGitHubHost = hostname === 'GITHUB.COM'; |
| 106 | const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); |
| 107 | const isLocalHost = hostname.endsWith('.LOCALHOST'); |
| 108 | |
| 109 | return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; |
| 110 | } |
| 111 | |
| 112 | export function isCacheFeatureAvailable(): boolean { |
| 113 | if (cache.isFeatureAvailable()) { |
no outgoing calls
no test coverage detected