mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
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.
13 lines
502 B
TypeScript
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
|
|
}
|