Files
orca/src/shared/github-repository-identity-key.ts
T
Jinjing 93d8a04992 Route gh host qualification through runner options instead of argv sniff
Move GHES/GH_HOST resolution from parsing --hostname/--repo out of gh argv to an explicit options.host passed through ghExecFileAsync, since SSH-backed repos spawn gh with no cwd and argv sniffing couldn't reliably detect the target host. The runner now injects --hostname and qualifies --repo/-R at spawn time from options.host, and rate-limit scoping/guards use the same explicit host instead of inferring it. Also adds a shared githubRepoIdentityKey helper to keep cache/store keys consistent with the new host-aware repository identity.
2026-07-20 12:35:24 -07:00

13 lines
502 B
TypeScript

// Why: cache keys and equality checks for GitHub repos must include the host,
// or a GHES repo and a same-named github.com repo would collide. github.com is
// omitted so pre-Enterprise host-less keys stay stable.
export function githubRepoIdentityKey(repo: {
owner: string
repo: string
host?: string
}): string {
const slug = `${repo.owner.toLowerCase()}/${repo.repo.toLowerCase()}`
const host = repo.host?.toLowerCase()
return host && host !== 'github.com' ? `${host}/${slug}` : slug
}