Commit graph

13 commits

Author SHA1 Message Date
Mislav Marohnić
662f83fcb9 Fix release download
Only ever try to set an `Authorization` request header to hosts that we
have OAuth credentials for; skip the header otherwise.
2020-09-14 15:31:31 +02:00
Mislav Marohnić
c80292c2e8 Extend Config object with GITHUB_TOKEN support
Adding GITHUB_TOKEN & GITHUB_ENTERPRISE_TOKEN support orthogonal to
Config was getting out of hand, especially in `auth` commands that
adjust their messaging and error status based on the presence of these
environment variables.

The new approach builds in support for tokens from environment straight
into Config object by composition. Thus, commands need not ever be
concerned with any specific environment variables.
2020-09-07 21:33:26 +02:00
Mislav Marohnić
feadf684fb Merge remote-tracking branch 'origin' into ghe-auth-tweaks 2020-09-07 17:37:16 +02:00
Mislav Marohnić
995828abf8 Avoid setting a default Accept header in hub api
Due to our HTTP client default behavior, an `Accept` header is added to
all API requests. This is fine for all commands except `gh api`, where
the user should ideally have fine-grained control over most aspects of
HTTP requests and where there should be little to no defaults in general.
2020-09-04 17:42:57 +02:00
Mislav Marohnić
2bb5e052d8 Send GITHUB_TOKEN to github.com and GITHUB_ENTERPRISE_TOKEN to GHES 2020-09-04 17:25:37 +02:00
vilmibm
cba401deb0 check parent annotatiosn for auth skip 2020-08-19 10:21:19 -05:00
vilmibm
621f6a262b minor 2020-08-19 10:11:16 -05:00
vilmibm
b1a6346e07 take out auto browser flow 2020-08-18 17:57:52 -05:00
vilmibm
ff9ecd2944 CTA for ghes remote auth case 2020-08-18 17:57:52 -05:00
Mislav Marohnić
d8c5b7bfc0
Merge pull request #1517 from cli/select-host
Allow explicitly setting hostname for gh operations
2020-08-14 19:08:13 +02:00
vilmibm
1efd3ebb51 rebase strife 2020-08-12 12:07:36 -05:00
Mislav Marohnić
4315c09501 Ignore non-pre-authenticated hosts when parsing git remotes
This ensures that while having git remotes to point to either
`github.com` or authenticated GHE instances, adding another git remote
pointing to an unrelated host won't change the remote resolution in any
way, even if the unrelated remote is called `upstream` or `github` (and
thus normally took precedence).
2020-08-12 18:13:05 +02:00
Mislav Marohnić
aef1a4ba4d Extract root command and factory logic into separate packages 2020-08-07 14:40:33 +02:00