Skip to content

Commit

Permalink
Move isGhes utility to helpers package
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-laevskii committed Aug 30, 2023
1 parent d0f7efa commit 9d88018
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
5 changes: 0 additions & 5 deletions packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,3 @@ export {markdownSummary} from './summary'
* Path exports
*/
export {toPosixPath, toWin32Path, toPlatformPath} from './path-utils'

/**
* isGhes helper export
*/
export {isGhes} from './utils'
8 changes: 0 additions & 8 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,3 @@ export function toCommandProperties(
endColumn: annotationProperties.endColumn
}
}

/**
* Returns whether or not action runs on GitHub Enterprise Server.
*/
export function isGhes(): boolean {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'
}
2 changes: 1 addition & 1 deletion packages/helpers/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@

export {isGhes} from './is-ghes'
4 changes: 4 additions & 0 deletions packages/helpers/src/is-ghes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function isGhes(): boolean {
const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'
return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'
}

0 comments on commit 9d88018

Please sign in to comment.