fix: normalize hostname for auth login (#6999)
Co-authored-by: Mislav Marohnić <mislav@github.com>
This commit is contained in:
parent
dbc2f05124
commit
3d8057d856
1 changed files with 5 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue