From 3d82eb3719c5829d8eccfc96f2c6483d1de08864 Mon Sep 17 00:00:00 2001 From: John Wesley Walker III <81404201+jww3@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:26:24 +0000 Subject: [PATCH] ran `npm run format` and `npm run build` --- dist/cache-save/index.js | 9 ++++++--- dist/setup/index.js | 9 ++++++--- src/cache-utils.ts | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 271b87a..8fdc7ad 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() { exports.isCacheFeatureAvailable = isCacheFeatureAvailable; /** * Returns this action runs on GitHub Enterprise Server or not. - * (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134) */ function isGhes() { - const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; - return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; + const ghUrl = new URL(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'); + return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; } diff --git a/dist/setup/index.js b/dist/setup/index.js index 771ab51..b810e67 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -93633,11 +93633,14 @@ function isCacheFeatureAvailable() { exports.isCacheFeatureAvailable = isCacheFeatureAvailable; /** * Returns this action runs on GitHub Enterprise Server or not. - * (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134) */ function isGhes() { - const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; - return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; + const ghUrl = new URL(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'); + return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; } diff --git a/src/cache-utils.ts b/src/cache-utils.ts index 9d190b8..c487273 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -96,10 +96,10 @@ 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; }