mirror of
https://github.com/actions/setup-java.git
synced 2025-04-18 00:46:45 +00:00
Refine isGhes
logic
This commit is contained in:
parent
83a06ff9d9
commit
31ee449301
1 changed files with 7 additions and 1 deletions
|
@ -92,7 +92,13 @@ export function isGhes(): boolean {
|
|||
const ghUrl = new URL(
|
||||
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
||||
);
|
||||
return ghUrl.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
|
||||
}
|
||||
|
||||
export function isCacheFeatureAvailable(): boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue