()
| 113 | } |
| 114 | |
| 115 | export function isGhes(): boolean { |
| 116 | const ghUrl = new URL( |
| 117 | process.env['GITHUB_SERVER_URL'] || 'https://github.com' |
| 118 | ); |
| 119 | |
| 120 | const hostname = ghUrl.hostname.trimEnd().toUpperCase(); |
| 121 | const isGitHubHost = hostname === 'GITHUB.COM'; |
| 122 | const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); |
| 123 | const isLocalHost = hostname.endsWith('.LOCALHOST'); |
| 124 | |
| 125 | return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; |
| 126 | } |
| 127 | |
| 128 | export function isCacheFeatureAvailable(): boolean { |
| 129 | if (cache.isFeatureAvailable()) { |
no outgoing calls
no test coverage detected