From c6892d6ef7b790c7df61843ed91a8c6ac6bdf6ca Mon Sep 17 00:00:00 2001 From: John Wesley Walker III <81404201+jww3@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:32:09 +0000 Subject: [PATCH] ran 'npm run format' --- dist/cache-save/index.js | 6 +++++- dist/setup/index.js | 6 +++++- src/cache-utils.ts | 10 +++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 8918271a..b3a950ff 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -83977,7 +83977,11 @@ const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependency exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies; 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/dist/setup/index.js b/dist/setup/index.js index e1b7296f..832d1db3 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -93598,7 +93598,11 @@ const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependency exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies; 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/cache-utils.ts b/src/cache-utils.ts index 4749b92f..89841bc1 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -296,12 +296,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 {