From 3446e0b2ef04400449c16aefb6d4652cc4564bdf Mon Sep 17 00:00:00 2001 From: John Wesley Walker III <81404201+jww3@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:23:42 +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 595ce84..1936c6b 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -81175,7 +81175,11 @@ const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, exports.getCacheDirectoryPath = getCacheDirectoryPath; 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 d4b4aa8..f21396a 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -88165,7 +88165,11 @@ const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, exports.getCacheDirectoryPath = getCacheDirectoryPath; 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 a209309..41f8b32 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -64,12 +64,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 {