cli icon indicating copy to clipboard operation
cli copied to clipboard

"github.com." is a GitHub host.

Open docwhat opened this issue 4 years ago • 3 comments

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.

docwhat avatar Dec 29 '20 17:12 docwhat

Workaround

Remove trailing . from HostName.

docwhat avatar Dec 29 '20 17:12 docwhat

this does indeed seem worth fixing to me.

vilmibm avatar Jan 27 '21 23:01 vilmibm

Just hit this issue now. Glad I’m not the only one. A bit disappointed the issue stayed open for this long.

remino avatar Sep 08 '22 10:09 remino