mirror of https://github.com/actions/toolkit
Move isGhes utility to core file
parent
ea267efe86
commit
3cc6d13dbb
|
@ -372,6 +372,14 @@ export async function getIDToken(aud?: string): Promise<string> {
|
||||||
return await OidcClient.getIDToken(aud)
|
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
|
* Summary exports
|
||||||
*/
|
*/
|
||||||
|
@ -386,8 +394,3 @@ export {markdownSummary} from './summary'
|
||||||
* Path exports
|
* Path exports
|
||||||
*/
|
*/
|
||||||
export {toPosixPath, toWin32Path, toPlatformPath} from './path-utils'
|
export {toPosixPath, toWin32Path, toPlatformPath} from './path-utils'
|
||||||
|
|
||||||
/**
|
|
||||||
* isGhes helper export
|
|
||||||
*/
|
|
||||||
export {isGhes} from './utils'
|
|
||||||
|
|
|
@ -39,11 +39,3 @@ export function toCommandProperties(
|
||||||
endColumn: annotationProperties.endColumn
|
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'
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue