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.
This commit is contained in:
Jinjing
2026-07-19 18:03:48 -07:00
parent 273c56c54f
commit 58034d2f74
28 changed files with 590 additions and 327 deletions
+1 -3
View File
@@ -160,15 +160,13 @@ describe('issue source operations', () => {
expect(ghExecFileAsyncMock).toHaveBeenCalledWith(
[
'api',
'--hostname',
'github.acme-corp.com',
'-X',
'POST',
'repos/team/orca/issues/7/comments',
'--raw-field',
'body=Enterprise comment'
],
{}
expect.objectContaining({ host: 'github.acme-corp.com' })
)
})