diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 699cdcf77..84894bf10 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -151,6 +151,11 @@ func loginRun(opts *LoginOptions) error { } } + // The go-gh Config object currently does not support case-insensitive lookups for host names, + // so normalize the host name case here before performing any lookups with it or persisting it. + // https://github.com/cli/go-gh/pull/105 + hostname = strings.ToLower(hostname) + if src, writeable := shared.AuthTokenWriteable(authCfg, hostname); !writeable { fmt.Fprintf(opts.IO.ErrOut, "The value of the %s environment variable is being used for authentication.\n", src) fmt.Fprint(opts.IO.ErrOut, "To have GitHub CLI store credentials instead, first clear the value from the environment.\n")