ran npm run format and npm run build

This commit is contained in:
John Wesley Walker III 2024-10-18 13:26:24 +00:00
parent fe7ff1148a
commit 3d82eb3719
3 changed files with 17 additions and 11 deletions

View File

@ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/** /**
* Returns this action runs on GitHub Enterprise Server or not. * 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() { function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return new URL(url).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;
} }

9
dist/setup/index.js vendored
View File

@ -93633,11 +93633,14 @@ function isCacheFeatureAvailable() {
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/** /**
* Returns this action runs on GitHub Enterprise Server or not. * 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() { function isGhes() {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return new URL(url).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;
} }

View File

@ -96,10 +96,10 @@ function isGhes(): boolean {
process.env['GITHUB_SERVER_URL'] || 'https://github.com' process.env['GITHUB_SERVER_URL'] || 'https://github.com'
); );
const hostname = ghUrl.hostname.trimEnd().toUpperCase() const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'GITHUB.COM' const isGitHubHost = hostname === 'GITHUB.COM';
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM') const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
const isLocalHost = hostname.endsWith('.LOCALHOST') const isLocalHost = hostname.endsWith('.LOCALHOST');
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
} }