From e9ea06f4c2b35dad2177a2fafc727463e2ce9f4e Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Fri, 17 Apr 2026 16:21:35 +0200 Subject: [PATCH] fix: include app owner in GitHub App URL for GHE Cloud (#8846) * fix: include app owner in GitHub App installation URL for GHE Cloud GHE Cloud custom domains (*.ghe.com) require the owner (org/user) in the app installation URL path: /apps/{owner}/{slug}/installations/new. Adds an optional app_owner field to the GHES app config. Co-Authored-By: Claude Opus 4.6 (1M context) * chore: update ee-repo-ref.txt Co-Authored-By: Claude Opus 4.6 (1M context) * chore: update ee-repo-ref to 2c2b8dc99689f54b8cd916fb9472fd5698b09478 This commit updates the EE repository reference after PR #539 was merged in windmill-ee-private. Previous ee-repo-ref: 40dd503d8c563ff93fd2ee3fd8830a5b1c4428d2 New ee-repo-ref: 2c2b8dc99689f54b8cd916fb9472fd5698b09478 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: windmill-internal-app[bot] --- backend/ee-repo-ref.txt | 2 +- backend/windmill-api/openapi.yaml | 3 +++ .../instanceSettings/GhesAppSettings.svelte | 17 +++++++++++++++++ frontend/src/lib/githubApp.ts | 7 ++++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 0a283d0d3a..998c232e11 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -a28f3509d0aa7c0e17fa6dcb1d03d935a7a2a11c +2c2b8dc99689f54b8cd916fb9472fd5698b09478 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index a3505eaac9..989fe58c77 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -2447,6 +2447,9 @@ paths: type: string client_id: type: string + app_owner: + type: string + nullable: true required: - base_url - app_slug diff --git a/frontend/src/lib/components/instanceSettings/GhesAppSettings.svelte b/frontend/src/lib/components/instanceSettings/GhesAppSettings.svelte index 3d6c314812..e94e56be0c 100644 --- a/frontend/src/lib/components/instanceSettings/GhesAppSettings.svelte +++ b/frontend/src/lib/components/instanceSettings/GhesAppSettings.svelte @@ -152,6 +152,23 @@ bind:value={$values['github_enterprise_app'].client_id} /> +
+ + + + Organization or user that owns the GitHub App. Required for GHE Cloud (*.ghe.com) domains. + +
diff --git a/frontend/src/lib/githubApp.ts b/frontend/src/lib/githubApp.ts index 2f6ec1c1de..be82fb3940 100644 --- a/frontend/src/lib/githubApp.ts +++ b/frontend/src/lib/githubApp.ts @@ -142,7 +142,12 @@ export async function loadGithubInstallations( const hostname = new URL(ghesBaseUrl).hostname const isGHES = hostname !== 'github.com' && !hostname.endsWith('.ghe.com') const appsPath = isGHES ? 'github-apps' : 'apps' - state.githubInstallationUrl = `${ghesBaseUrl}/${appsPath}/${ghesConfig.app_slug}/installations/new?state=${stateParam}` + // GHE Cloud (*.ghe.com) requires the app owner (org/user) in the URL path + const appPath = + hostname.endsWith('.ghe.com') && ghesConfig.app_owner + ? `${ghesConfig.app_owner}/${ghesConfig.app_slug}` + : ghesConfig.app_slug + state.githubInstallationUrl = `${ghesBaseUrl}/${appsPath}/${appPath}/installations/new?state=${stateParam}` } else { state.githubInstallationUrl = `https://github.com/apps/windmill-sync-helper/installations/new?state=${stateParam}` }