Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revise isGhes logic
  • Loading branch information
jww3 authored Oct 18, 2024
commit 1f3204b79faae2b56742abeb089b2feca7602421
8 changes: 7 additions & 1 deletion src/cache-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,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 {
Expand Down
Loading