diff --git a/dist/setup/index.js b/dist/setup/index.js index f1e3e297..e56f9660 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -92017,7 +92017,11 @@ function validatePythonVersionFormatForPyPy(version) { exports.validatePythonVersionFormatForPyPy = validatePythonVersionFormatForPyPy; function isGhes() { const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); - return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'; + const hostname = ghUrl.hostname.trimEnd().toUpperCase(); + const isGitHubHost = hostname === 'GITHUB.COM'; + const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); + const isLocalHost = hostname.endsWith('.LOCALHOST'); + return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; } exports.isGhes = isGhes; function isCacheFeatureAvailable() { diff --git a/src/utils.ts b/src/utils.ts index aac0a19b..a6dab63e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -117,12 +117,12 @@ export function isGhes(): boolean { process.env['GITHUB_SERVER_URL'] || 'https://github.com' ); - const hostname = ghUrl.hostname.trimEnd().toUpperCase() - const isGitHubHost = hostname === 'GITHUB.COM' - const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM') - const isLocalHost = hostname.endsWith('.LOCALHOST') + const hostname = ghUrl.hostname.trimEnd().toUpperCase(); + const isGitHubHost = hostname === 'GITHUB.COM'; + const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); + const isLocalHost = hostname.endsWith('.LOCALHOST'); - return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost + return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; } export function isCacheFeatureAvailable(): boolean {