cli / cli/cli

"github.com." is a GitHub host.

Open
#2,709 3 comments 2 reactions 0 assignees View on GitHub
bug priority-3
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### 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:

```ssh
Host github github.com www.github.com gist gist.github.com
HostName github.com.
```

Then run `gh repo clone `

Within the checkout, try something like `gh repo view --web`.

You'll get the error:

```sh
$ 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.