cli
cli copied to clipboard
"github.com." is a GitHub host.
Describe the bug
gh version 1.4.0 (2020-12-15) doesn't understand that github.com. (note the trailing dot) is a known GitHub host.
I've been using the trailing dot to prevent search domain attacks when using my laptop on wifi.
Steps to reproduce the behavior
In your ~/.ssh/config add:
Host github github.com www.github.com gist gist.github.com
HostName github.com.
Then run gh repo clone <repos>
Within the checkout, try something like gh repo view --web.
You'll get the error:
$ gh repo view --web
none of the git remotes configured for this repository point to a known GitHub host. To tell gh about a new GitHub host, please use `gh auth login`
Expected vs actual behavior
The utility should recognize github.com. as a GitHub host.
Workaround
Remove trailing . from HostName.
this does indeed seem worth fixing to me.
Just hit this issue now. Glad I’m not the only one. A bit disappointed the issue stayed open for this long.