[Backport 5.5.x] fix(batches): the baseURL for github instance is now updated when creating a GitHub app (#63833)

Closes SRCH-723

The baseURL for GitHub apps defaults to `https://github.com` when no
`externalServiceURL`, we somehow missed this during our testing.

![CleanShot 2024-07-12 at 11 57
00@2x](https://github.com/user-attachments/assets/99b68a11-de38-4a2d-8c4c-3219f0c9abf7)


## Test plan



Manual testing with the GHE instance.

## Changelog


 <br> Backport 1c40c9e5bc from #63803

Co-authored-by: Bolaji Olajide <25608335+BolajiOlajide@users.noreply.github.com>
Co-authored-by: Anish Lakhwara <anish+github@lakhwara.com>
This commit is contained in:
Release Bot 2024-07-17 11:18:13 -07:00 committed by GitHub
parent 6b8d334563
commit 9cf00da25a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -383,6 +383,7 @@ const AddToken: FC<AddTokenProps> = ({
authenticatedUser={user as unknown as AuthenticatedUser}
minimizedMode={true}
kind={kind}
externalServiceURL={externalServiceURL}
/>
)}
</>

View File

@ -23,16 +23,18 @@ interface BatchChangesCreateGitHubAppPageProps {
authenticatedUser: AuthenticatedUser
minimizedMode?: boolean
kind: GitHubAppKind
externalServiceURL?: string
}
export const BatchChangesCreateGitHubAppPage: FC<BatchChangesCreateGitHubAppPageProps> = ({
minimizedMode,
kind,
authenticatedUser,
externalServiceURL,
}) => {
const location = useLocation()
const searchParams = new URLSearchParams(location.search)
const baseURL = searchParams.get('baseURL')
const baseURL = externalServiceURL || searchParams.get('baseURL')
const isGitHubAppKindCredential = kind === GitHubAppKind.USER_CREDENTIAL || kind === GitHubAppKind.SITE_CREDENTIAL