Describe the bug
➜ gh version
gh version 2.44.1 (2024-02-16)
https://github.com/cli/cli/releases/tag/v2.44.1
When targeting a host other than github.com host e.g. GHES, the --web functionality of project view and project list are broken because they always open the browser pointing at github.com.
This occurs because the buildURL function that creates the correct URL to browse to was never written to support hosts other than github.com:
|
// TODO: support non-github.com hostnames |
|
func buildURL(config listConfig) (string, error) { |
|
var url string |
|
if config.opts.owner == "@me" || config.opts.owner == "" { |
|
owner, err := config.client.ViewerLoginName() |
Steps to reproduce the behavior
- Authenticate with a host other than
github.com
GH_HOST=<host> gh project list --web
- See that the browser opens pointing at github.com
The same behaviour occurs for project view.
Expected vs actual behavior
The URL is opened targeting the correct host.
Extra Notes
Note that project view is likely to be fixed incidentally as part of #8773 which will take a different approach to obtaining the correct URL.
Describe the bug
When targeting a host other than github.com host e.g.
GHES, the--webfunctionality ofproject viewandproject listare broken because they always open the browser pointing at github.com.This occurs because the
buildURLfunction that creates the correct URL to browse to was never written to support hosts other than github.com:cli/pkg/cmd/project/list/list.go
Lines 113 to 117 in 590208f
Steps to reproduce the behavior
github.comGH_HOST=<host> gh project list --webThe same behaviour occurs for
project view.Expected vs actual behavior
The URL is opened targeting the correct host.
Extra Notes
Note that
project viewis likely to be fixed incidentally as part of #8773 which will take a different approach to obtaining the correct URL.