fix: accept enterprise managed GitHub owner logins (#20450)

Unify owner validation across project pickers and repository overrides. Preserve EMU usernames in API and auth-status branch-prefix resolution, with regression coverage.

Co-authored-by: Neil <neil@stably.ai>
This commit is contained in:
Gon Song
2026-09-16 14:41:15 -07:00
committed by GitHub
co-authored by Neil
parent 6101f0169f
commit 85d1ffc072
16 changed files with 364 additions and 104 deletions
@@ -1,3 +1,4 @@
import { GITHUB_OWNER_SLUG_RE } from '../../shared/github/owner-slug'
import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types'
export type GitHubApiRepositoryResolution =
@@ -7,7 +8,7 @@ export type GitHubApiRepositoryResolution =
| (() => Promise<GitHubOwnerRepo | null>)
// Why: renderer/RPC overrides reach authenticated REST paths.
const OWNER_SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9-]*$/
const OWNER_SLUG_RE = GITHUB_OWNER_SLUG_RE
const REPOSITORY_SLUG_RE = /^[A-Za-z0-9._-]+$/
export function isValidGitHubApiRepository(repository: GitHubOwnerRepo): boolean {