You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use GH_HOST env var instead of --hostname flag for gh repo view and gh pr create (#26311)
* Initial plan
* fix: use GH_HOST env var instead of --hostname flag for gh repo view and gh pr create
The --hostname flag is only valid for `gh api`, not for `gh repo view` or
`gh pr create`. This caused failures on GHES/Proxima with:
"unknown flag: --hostname"
Replace the invalid --hostname flag with the GH_HOST environment variable,
which is the correct approach for these commands. Extract the env var setup
into a reusable setGHHostEnv helper to avoid duplication.
Fixes: gh aw add-wizard --create-pull-request on GHES/Proxima deployments
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9ad4e273-0356-4650-a286-ade3682b979c
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
* fix: replace --hostname with GH_HOST env var for non-api gh commands
Address review feedback on the original PR:
1. Add RunGHWithHost() and SetGHHostEnv() to pkg/workflow/github_cli.go
as shared helpers, preserving spinner UX and enrichGHError wrapping.
2. Fix pr_command.go to use RunGHWithHost() for gh repo view and
gh pr create (restores spinner + error enrichment lost in original PR).
3. Fix audit.go:588 — gh run view also does not support --hostname.
This was the third affected call site documented in #26310 but
missed in the original PR.
4. Remove the local setGHHostEnv() from pr_command.go in favor of
the shared exported SetGHHostEnv() in github_cli.go.
5. Add TestSetGHHostEnv with 5 test cases covering github.com no-op,
empty host no-op, GHES host, Proxima host, and append-to-existing-env.
Fixes#26310
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments