Bug
gh aw add-wizard with --create-pull-request and gh aw audit fail on GitHub Enterprise Server and Proxima (data residency) deployments because --hostname is passed to gh subcommands that do not support it.
Example error from add-wizard:
✗ failed to add workflow
failed to create PR
failed to get current repository info
exit status 1: unknown flag: --hostname
Usage: gh repo view [] [flags]
Root Cause
--hostname is only a valid flag on gh api. It does not exist on gh repo view, gh pr create, or gh run view.
Three call sites incorrectly pass --hostname to non-gh api commands:
1. pkg/cli/pr_command.go:777 — gh repo view
repoViewArgs := []string{"repo", "view", "--json", "owner,name"}
if remoteHost != "github.com" {
repoViewArgs = append(repoViewArgs, "--hostname", remoteHost) // ❌ invalid
}
2. pkg/cli/pr_command.go:804 — gh pr create
prCreateArgs := []string{"pr", "create", "--repo", repoSpec, ...}
if remoteHost != "github.com" {
prCreateArgs = append(prCreateArgs, "--hostname", remoteHost) // ❌ invalid
}
3. pkg/cli/audit.go:588 — gh run view
args := []string{"run", "view"}
// ...
if hostname != "" && hostname != "github.com" {
args = append(args, "--hostname", hostname) // ❌ invalid
}
All three were introduced in #20898.
Correct Usages (no change needed)
These all correctly pass --hostname to gh api:
| File |
Line |
Command |
audit.go:772 |
gh api |
✅ |
audit.go:850 |
gh api |
✅ |
logs_download.go:303 |
gh api |
✅ |
logs_download.go:500 |
gh api |
✅ |
audit_comparison.go:479 |
gh api |
✅ |
remote_fetch.go:415 |
gh api |
✅ |
Proposed Fix
Replace --hostname with the GH_HOST environment variable for the three affected call sites. The RunGH / RunGHWithEnv helper should accept an optional env override:
// For gh repo view and gh pr create — set GH_HOST in the process environment
env := os.Environ()
if remoteHost != "github.com" {
env = append(env, "GH_HOST="+remoteHost)
}
For gh run view in audit.go, the same GH_HOST approach applies.
Affected Commands
gh aw add-wizard <workflow> --create-pull-request (on GHES/Proxima repos)
gh aw add <workflow> --create-pull-request (on GHES/Proxima repos)
gh aw audit <run-id> (on GHES/Proxima repos — job-level audit path)
The bug only triggers when the git remote host is not github.com.
Reported Via
Customer escalation: https://github.com/github/copilot-agent-runtime/issues/5313#issuecomment-4247334484 (Verizon on Proxima/data residency)
Bug
gh aw add-wizardwith--create-pull-requestandgh aw auditfail on GitHub Enterprise Server and Proxima (data residency) deployments because--hostnameis passed toghsubcommands that do not support it.Example error from
add-wizard:Root Cause
--hostnameis only a valid flag ongh api. It does not exist ongh repo view,gh pr create, orgh run view.Three call sites incorrectly pass
--hostnameto non-gh apicommands:1.
pkg/cli/pr_command.go:777—gh repo view2.
pkg/cli/pr_command.go:804—gh pr create3.
pkg/cli/audit.go:588—gh run viewAll three were introduced in #20898.
Correct Usages (no change needed)
These all correctly pass
--hostnametogh api:audit.go:772gh apiaudit.go:850gh apilogs_download.go:303gh apilogs_download.go:500gh apiaudit_comparison.go:479gh apiremote_fetch.go:415gh apiProposed Fix
Replace
--hostnamewith theGH_HOSTenvironment variable for the three affected call sites. TheRunGH/RunGHWithEnvhelper should accept an optional env override:For
gh run viewin audit.go, the sameGH_HOSTapproach applies.Affected Commands
gh aw add-wizard <workflow> --create-pull-request(on GHES/Proxima repos)gh aw add <workflow> --create-pull-request(on GHES/Proxima repos)gh aw audit <run-id>(on GHES/Proxima repos — job-level audit path)The bug only triggers when the git remote host is not
github.com.Reported Via
Customer escalation: https://github.com/github/copilot-agent-runtime/issues/5313#issuecomment-4247334484 (Verizon on Proxima/data residency)