From 3cc6d13dbbcd370155745bc3726bc62c2e1643ff Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Wed, 4 Oct 2023 08:11:25 +0200 Subject: [PATCH] Move isGhes utility to core file --- packages/core/src/core.ts | 13 ++++++++----- packages/core/src/utils.ts | 8 -------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index f33b7d86..31c4b113 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -372,6 +372,14 @@ export async function getIDToken(aud?: string): Promise { return await OidcClient.getIDToken(aud) } +/** + * Returns whether action runs on GitHub Enterprise Server or not. + */ +export function isGhes(): boolean { + const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com' + return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM' +} + /** * Summary exports */ @@ -386,8 +394,3 @@ export {markdownSummary} from './summary' * Path exports */ export {toPosixPath, toWin32Path, toPlatformPath} from './path-utils' - -/** - * isGhes helper export - */ -export {isGhes} from './utils' diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index eb7825f5..c43f3870 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -39,11 +39,3 @@ export function toCommandProperties( endColumn: annotationProperties.endColumn } } - -/** - * Returns this action runs on GitHub Enterprise Server or not. - */ -export function isGhes(): boolean { - const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com' - return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM' -}