updating alowed hosts in isGhes check

updating alowed hosts in artifact ghes check

using dot prepend ghe host
This commit is contained in:
eggyhead committed 2024-01-31 16:30:37 +00:00
1 parent d12fc5d177
commit db6df55535
2 files changed
+35 -1

No files matched your search

+6 -1
View File
@@ -27,7 +27,12 @@ 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 isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'))
return !isGitHubHost && !isGheHost
}
export function getGitHubWorkspaceDir(): string {