Commit graph

8 commits

Author SHA1 Message Date
Nate Smith
4b415f80d7
Merge pull request #5022 from cli/config-defaults
add GetOrDefault and related methods to Config
2022-01-17 10:44:28 -06:00
Mislav Marohnić
583af3e54c
Allow gh auth git-credential to authenticate GitHub Gist requests (#3064)
* Allow `gh auth git-credential` to authenticate GitHub Gist requests

When there are stored credentials for `example.com`, allow using them to
authenticate requests to `gist.example.com` as well.

* Fix writing out of credential config

* remove unneccessary function

* actually delete

Co-authored-by: nate smith <vilmibm@github.com>
2022-01-14 22:18:07 +00:00
nate smith
0a619d422a undo overzealous find/replace 2022-01-14 15:27:05 -06:00
nate smith
562f1b3d0d add GetOrDefault functionality to config 2022-01-11 14:56:58 -06:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
9bf1668b3f Fix auth git-credential when the token comes from environment
When a token such as GH_TOKEN is set through environment variables and
`~/.config/gh/hosts.yml` is non-existent, the `auth git-credential get`
command used to fail due to missing username.

Since GitHub username isn't at all required for token authentication,
use the `x-access-token` faux username instead of trying to obtain one
from a config file.
2021-02-19 15:37:11 +01:00
Mislav Marohnić
3c76eb15a4 Add tests for auth git-credential command 2020-12-07 20:01:53 +01:00
Mislav Marohnić
d56d92c908 If git credential helper is non-defined, set gh as credential helper 2020-11-23 20:20:05 +01:00