Merge pull request #101 from immutable-actions/ddivad195/fix-url-parsing

fix isEnterprise check
This commit is contained in:
David Daly
2024-03-05 17:08:55 +00:00
committed by GitHub
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ function configureEventContext(): void {
process.env.GITHUB_API_URL = 'apiBaseUrl' process.env.GITHUB_API_URL = 'apiBaseUrl'
process.env.RUNNER_TEMP = 'runnerTempDir' process.env.RUNNER_TEMP = 'runnerTempDir'
process.env.GITHUB_SHA = 'sha' process.env.GITHUB_SHA = 'sha'
process.env.GITHUB_SERVER_URL = 'github.com' process.env.GITHUB_SERVER_URL = 'https://github.com/'
process.env.GITHUB_REPOSITORY_ID = 'repositoryId' process.env.GITHUB_REPOSITORY_ID = 'repositoryId'
process.env.GITHUB_REPOSITORY_OWNER_ID = 'repositoryOwnerId' process.env.GITHUB_REPOSITORY_OWNER_ID = 'repositoryOwnerId'
github.context.eventName = 'release' github.context.eventName = 'release'
Generated Vendored
+2 -3
View File
@@ -128230,9 +128230,8 @@ async function resolvePublishActionOptions() {
} }
// Required Values fetched from the GitHub API // Required Values fetched from the GitHub API
const containerRegistryUrl = await iaToolkit.getContainerRegistryURL(apiBaseUrl); const containerRegistryUrl = await iaToolkit.getContainerRegistryURL(apiBaseUrl);
// TODO: Figure out if there's a better way to do this const isEnterprise = !githubServerUrl.includes('https://github.com') &&
const isEnterprise = !githubServerUrl.endsWith('github.com') && !githubServerUrl.endsWith('.ghe.com');
!githubServerUrl.endsWith('ghe.com');
return { return {
event, event,
ref, ref,
+2 -3
View File
@@ -93,10 +93,9 @@ export async function resolvePublishActionOptions(): Promise<PublishActionOption
const containerRegistryUrl: URL = const containerRegistryUrl: URL =
await iaToolkit.getContainerRegistryURL(apiBaseUrl) await iaToolkit.getContainerRegistryURL(apiBaseUrl)
// TODO: Figure out if there's a better way to do this
const isEnterprise = const isEnterprise =
!githubServerUrl.endsWith('github.com') && !githubServerUrl.includes('https://github.com') &&
!githubServerUrl.endsWith('ghe.com') !githubServerUrl.endsWith('.ghe.com')
return { return {
event, event,