From 1511c9f225f5a7b2c884f0d35f5cdebe9cdfc858 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:28:48 +0000 Subject: [PATCH 01/22] build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.4 to 2.0.5 Bumps [github.com/cpuguy83/go-md2man/v2](https://github.com/cpuguy83/go-md2man) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/cpuguy83/go-md2man/releases) - [Commits](https://github.com/cpuguy83/go-md2man/compare/v2.0.4...v2.0.5) --- updated-dependencies: - dependency-name: github.com/cpuguy83/go-md2man/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 54d02ec8e..51083f997 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/cli/go-gh/v2 v2.10.0 github.com/cli/oauth v1.0.1 github.com/cli/safeexec v1.0.1 - github.com/cpuguy83/go-md2man/v2 v2.0.4 + github.com/cpuguy83/go-md2man/v2 v2.0.5 github.com/creack/pty v1.1.23 github.com/distribution/reference v0.5.0 github.com/gabriel-vasile/mimetype v1.4.5 diff --git a/go.sum b/go.sum index 416f2ee59..f0e05ee81 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,9 @@ github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AX github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/creack/pty v1.1.23 h1:4M6+isWdcStXEf15G/RbrMPOQj1dZ7HPZCGwE4kOeP0= github.com/creack/pty v1.1.23/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= From 8123de9722c698c2ebbb21bdd32516ca7bcad1bf Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Wed, 18 Sep 2024 14:05:04 -0700 Subject: [PATCH 02/22] fix tenant-awareness for trusted-root command Signed-off-by: Brian DeHamer --- pkg/cmd/attestation/trustedroot/trustedroot.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/attestation/trustedroot/trustedroot.go b/pkg/cmd/attestation/trustedroot/trustedroot.go index c9c3fdb04..c52bdac15 100644 --- a/pkg/cmd/attestation/trustedroot/trustedroot.go +++ b/pkg/cmd/attestation/trustedroot/trustedroot.go @@ -116,6 +116,12 @@ func getTrustedRoot(makeTUF tufClientInstantiator, opts *Options) error { // Disable local caching, so we get up-to-date response from TUF repository tufOpt.CacheValidity = 0 + // Target will be either the default trusted root, or the trust domain-qualified one + ghTR := defaultTR + if opts.TrustDomain != "" { + ghTR = fmt.Sprintf("%s.%s", opts.TrustDomain, defaultTR) + } + if opts.TufUrl != "" && opts.TufRootPath != "" { tufRoot, err := os.ReadFile(opts.TufRootPath) if err != nil { @@ -126,7 +132,7 @@ func getTrustedRoot(makeTUF tufClientInstantiator, opts *Options) error { tufOpt.RepositoryBaseURL = opts.TufUrl tufOptions = append(tufOptions, tufConfig{ tufOptions: tufOpt, - targets: []string{defaultTR}, + targets: []string{ghTR}, }) } else { // Get from both Sigstore public good and GitHub private instance @@ -137,14 +143,9 @@ func getTrustedRoot(makeTUF tufClientInstantiator, opts *Options) error { tufOpt = verification.GitHubTUFOptions() tufOpt.CacheValidity = 0 - targets := []string{defaultTR} - if opts.TrustDomain != "" { - targets = append(targets, fmt.Sprintf("%s.%s", - opts.TrustDomain, defaultTR)) - } tufOptions = append(tufOptions, tufConfig{ tufOptions: tufOpt, - targets: targets, + targets: []string{ghTR}, }) } From 5dd52463071d0eb053d675796eca1ff47bb20550 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 19 Sep 2024 14:52:16 -0700 Subject: [PATCH 03/22] Replace "GitHub Enterprise Server" with "other" in `gh auth login` prompt This change is meant to better support the login flow for other customers besides GitHub Enterprise Server customers that use the same login flow as GHES. --- pkg/cmd/auth/login/login.go | 2 +- pkg/cmd/auth/login/login_test.go | 52 ++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 9e27f28ac..2eded806e 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -222,7 +222,7 @@ func loginRun(opts *LoginOptions) error { } func promptForHostname(opts *LoginOptions) (string, error) { - options := []string{"GitHub.com", "GitHub Enterprise Server"} + options := []string{"GitHub.com", "other"} hostType, err := opts.Prompter.Select( "What account do you want to log into?", options[0], diff --git a/pkg/cmd/auth/login/login_test.go b/pkg/cmd/auth/login/login_test.go index d53dd3f0b..555606d56 100644 --- a/pkg/cmd/auth/login/login_test.go +++ b/pkg/cmd/auth/login/login_test.go @@ -2,6 +2,7 @@ package login import ( "bytes" + "fmt" "net/http" "regexp" "runtime" @@ -546,7 +547,7 @@ func Test_loginRun_Survey(t *testing.T) { wantErrOut: regexp.MustCompile("Tip: you can generate a Personal Access Token here https://rebecca.chambers/settings/tokens"), }, { - name: "choose enterprise", + name: "choose other", wantHosts: heredoc.Doc(` brad.vickers: users: @@ -564,7 +565,7 @@ func Test_loginRun_Survey(t *testing.T) { pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) { switch prompt { case "What account do you want to log into?": - return prompter.IndexFor(opts, "GitHub Enterprise Server") + return prompter.IndexFor(opts, "other") case "What is your preferred protocol for Git operations on this host?": return prompter.IndexFor(opts, "HTTPS") case "How would you like to authenticate GitHub CLI?": @@ -803,3 +804,50 @@ func Test_loginRun_Survey(t *testing.T) { }) } } + +func Test_promptForHostname(t *testing.T) { + tests := []struct { + name string + options []string + selectedIndex int + // This is so we can test that the options in the function don't change + expectedSelection string + inputHostname string + expect string + }{ + { + name: "select GitHub.com", + selectedIndex: 0, + expectedSelection: "GitHub.com", + expect: "github.com", + }, + { + name: "select other", + selectedIndex: 1, + expectedSelection: "other", + inputHostname: "github.enterprise.com", + expect: "github.enterprise.com", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + promptMock := &prompter.PrompterMock{ + SelectFunc: func(_ string, _ string, options []string) (int, error) { + if options[tt.selectedIndex] != tt.expectedSelection { + return 0, fmt.Errorf("expected %s at index %d, but got %s", tt.expectedSelection, tt.selectedIndex, options[tt.selectedIndex]) + } + return tt.selectedIndex, nil + }, + InputHostnameFunc: func() (string, error) { + return tt.inputHostname, nil + }, + } + opts := &LoginOptions{ + Prompter: promptMock, + } + hostname, err := promptForHostname(opts) + require.NoError(t, err) + require.Equal(t, tt.expect, hostname) + }) + } +} From 46790977bb69023ae51a47469b39f6855d9c90af Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 19 Sep 2024 15:11:02 -0700 Subject: [PATCH 04/22] Add documentation explaining how to use `hostname` for `gh auth login` --- pkg/cmd/auth/login/login.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 2eded806e..613555dd7 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -59,6 +59,10 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm Long: heredoc.Docf(` Authenticate with a GitHub host. + Your %[1]shostname%[1]s is the domain where the GitHub instance you are logging into is hosted. + For example, "github.com" is the default hostname for GitHub.com. To authenticate with + a different hostname like github.enterprise.com, use that hostname instead. + The default authentication mode is a web-based browser flow. After completion, an authentication token will be stored securely in the system credential store. If a credential store is not found or there is an issue using it gh will fallback From bc587f6576dc7a939545e791ee69ef969bcf5815 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 20 Sep 2024 13:55:20 -0700 Subject: [PATCH 05/22] Sentence case 'Other' option in hostname prompt --- pkg/cmd/auth/login/login.go | 2 +- pkg/cmd/auth/login/login_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 613555dd7..9066abd5d 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -226,7 +226,7 @@ func loginRun(opts *LoginOptions) error { } func promptForHostname(opts *LoginOptions) (string, error) { - options := []string{"GitHub.com", "other"} + options := []string{"GitHub.com", "Other"} hostType, err := opts.Prompter.Select( "What account do you want to log into?", options[0], diff --git a/pkg/cmd/auth/login/login_test.go b/pkg/cmd/auth/login/login_test.go index 555606d56..1cd955b1f 100644 --- a/pkg/cmd/auth/login/login_test.go +++ b/pkg/cmd/auth/login/login_test.go @@ -547,7 +547,7 @@ func Test_loginRun_Survey(t *testing.T) { wantErrOut: regexp.MustCompile("Tip: you can generate a Personal Access Token here https://rebecca.chambers/settings/tokens"), }, { - name: "choose other", + name: "choose Other", wantHosts: heredoc.Doc(` brad.vickers: users: @@ -565,7 +565,7 @@ func Test_loginRun_Survey(t *testing.T) { pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) { switch prompt { case "What account do you want to log into?": - return prompter.IndexFor(opts, "other") + return prompter.IndexFor(opts, "Other") case "What is your preferred protocol for Git operations on this host?": return prompter.IndexFor(opts, "HTTPS") case "How would you like to authenticate GitHub CLI?": @@ -816,15 +816,15 @@ func Test_promptForHostname(t *testing.T) { expect string }{ { - name: "select GitHub.com", + name: "select 'GitHub.com'", selectedIndex: 0, expectedSelection: "GitHub.com", expect: "github.com", }, { - name: "select other", + name: "select 'Other'", selectedIndex: 1, - expectedSelection: "other", + expectedSelection: "Other", inputHostname: "github.enterprise.com", expect: "github.enterprise.com", }, From 13e916bcfb22366d2d5db10b486ae066ce54b494 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 20 Sep 2024 14:10:05 -0700 Subject: [PATCH 06/22] Change prompts for `gh auth login` to reflect change from GHE to Other --- internal/prompter/prompter.go | 2 +- pkg/cmd/auth/login/login.go | 2 +- pkg/cmd/auth/login/login_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index 44579b189..1d4b11cbc 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -92,7 +92,7 @@ func (p *surveyPrompter) InputHostname() (string, error) { var result string err := p.ask( &survey.Input{ - Message: "GHE hostname:", + Message: "Hostname:", }, &result, survey.WithValidator(func(v interface{}) error { return ghinstance.HostnameValidator(v.(string)) })) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 9066abd5d..4d4db3259 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -228,7 +228,7 @@ func loginRun(opts *LoginOptions) error { func promptForHostname(opts *LoginOptions) (string, error) { options := []string{"GitHub.com", "Other"} hostType, err := opts.Prompter.Select( - "What account do you want to log into?", + "Where do you use GitHub?", options[0], options) if err != nil { diff --git a/pkg/cmd/auth/login/login_test.go b/pkg/cmd/auth/login/login_test.go index 1cd955b1f..3264ed91c 100644 --- a/pkg/cmd/auth/login/login_test.go +++ b/pkg/cmd/auth/login/login_test.go @@ -564,7 +564,7 @@ func Test_loginRun_Survey(t *testing.T) { prompterStubs: func(pm *prompter.PrompterMock) { pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) { switch prompt { - case "What account do you want to log into?": + case "Where do you use GitHub?": return prompter.IndexFor(opts, "Other") case "What is your preferred protocol for Git operations on this host?": return prompter.IndexFor(opts, "HTTPS") @@ -607,7 +607,7 @@ func Test_loginRun_Survey(t *testing.T) { prompterStubs: func(pm *prompter.PrompterMock) { pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) { switch prompt { - case "What account do you want to log into?": + case "Where do you use GitHub?": return prompter.IndexFor(opts, "GitHub.com") case "What is your preferred protocol for Git operations on this host?": return prompter.IndexFor(opts, "HTTPS") @@ -641,7 +641,7 @@ func Test_loginRun_Survey(t *testing.T) { prompterStubs: func(pm *prompter.PrompterMock) { pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) { switch prompt { - case "What account do you want to log into?": + case "Where do you use GitHub?": return prompter.IndexFor(opts, "GitHub.com") case "What is your preferred protocol for Git operations on this host?": return prompter.IndexFor(opts, "SSH") From 2059c630a27443df0d4c2185b26e22c592aaf3ef Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 20 Sep 2024 14:12:13 -0700 Subject: [PATCH 07/22] Update language on docstring for `gh auth login` --- pkg/cmd/auth/login/login.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 4d4db3259..a5e601960 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -59,8 +59,8 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm Long: heredoc.Docf(` Authenticate with a GitHub host. - Your %[1]shostname%[1]s is the domain where the GitHub instance you are logging into is hosted. - For example, "github.com" is the default hostname for GitHub.com. To authenticate with + The %[1]shostname%[1]s is the domain where the GitHub instance you are logging into is hosted. + For example, "github.com" is the hostname for GitHub.com. To authenticate with a different hostname like github.enterprise.com, use that hostname instead. The default authentication mode is a web-based browser flow. After completion, an From ccb830ca3674dc480cae08f026f3e298662e35e1 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 20 Sep 2024 15:51:07 -0700 Subject: [PATCH 08/22] Shorten language on Authenticate with a GitHub host. The default authentication mode is a web-based browser flow. After completion, an authentication token will be stored securely in the system credential store. If a credential store is not found or there is an issue using it gh will fallback to writing the token to a plain text file. See `gh auth status` for its stored location. Alternatively, use `--with-token` to pass in a token on standard input. The minimum required scopes for the token are: `repo`, `read:org`, and `gist`. Alternatively, gh will use the authentication token found in environment variables. This method is most suitable for "headless" use of gh such as in automation. See `gh help environment` for more info. To use gh in GitHub Actions, add `GH_TOKEN: ${{ github.token }}` to `env`. The git protocol to use for git operations on this host can be set with `--git-protocol`, or during the interactive prompting. Although login is for a single account on a host, setting the git protocol will take effect for all users on the host. Specifying `ssh` for the git protocol will detect existing SSH keys to upload, prompting to create and upload a new key if one is not found. This can be skipped with `--skip-ssh-key` flag. USAGE gh auth login [flags] FLAGS -p, --git-protocol string The protocol to use for git operations on this host: {ssh|https} -h, --hostname string The hostname of the GitHub instance to authenticate with --insecure-storage Save authentication credentials in plain text instead of credential store -s, --scopes strings Additional authentication scopes to request --skip-ssh-key Skip generate/upload SSH key prompt -w, --web Open a browser to authenticate --with-token Read token from standard input INHERITED FLAGS --help Show help for command EXAMPLES # Start interactive setup $ gh auth login # Authenticate against github.com by reading the token from a file $ gh auth login --with-token < mytoken.txt # Authenticate with specific host $ gh auth login --hostname enterprise.internal LEARN MORE Use `gh --help` for more information about a command. Read the manual at https://cli.github.com/manual Learn about exit codes using `gh help exit-codes` around Tylers-GitHub-MacBook.local --- pkg/cmd/auth/login/login.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index a5e601960..2a4f118cc 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -59,9 +59,7 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm Long: heredoc.Docf(` Authenticate with a GitHub host. - The %[1]shostname%[1]s is the domain where the GitHub instance you are logging into is hosted. - For example, "github.com" is the hostname for GitHub.com. To authenticate with - a different hostname like github.enterprise.com, use that hostname instead. + The %[1]shostname%[1]s is where you log in to GitHub. The default hostname is %[1]sgithub.com%[1]s. The default authentication mode is a web-based browser flow. After completion, an authentication token will be stored securely in the system credential store. From 1eda1b41a7af430a13d1c17f6c5d2fbbe1e6c3da Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Sat, 21 Sep 2024 14:56:43 -0500 Subject: [PATCH 09/22] Emit a log message when extension installation falls back to a darwin-amd64 binary on an Apple Silicon macOS machine --- pkg/cmd/extension/manager.go | 11 ++++++++--- pkg/cmd/extension/manager_test.go | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/extension/manager.go b/pkg/cmd/extension/manager.go index 410d4c224..2431c6b83 100644 --- a/pkg/cmd/extension/manager.go +++ b/pkg/cmd/extension/manager.go @@ -29,6 +29,8 @@ import ( // ErrInitialCommitFailed indicates the initial commit when making a new extension failed. var ErrInitialCommitFailed = errors.New("initial commit failed") +const darwinAmd64 = "darwin-amd64" + type Manager struct { dataDir func() string lookPath func(string) (string, error) @@ -266,13 +268,16 @@ func (m *Manager) installBin(repo ghrepo.Interface, target string) error { // if using an ARM-based Mac and an arm64 binary is unavailable, fall back to amd64 if a relevant binary is available and Rosetta 2 is installed if asset == nil && isMacARM { for _, a := range r.Assets { - if strings.HasSuffix(a.Name, "darwin-amd64") { + if strings.HasSuffix(a.Name, darwinAmd64) { if !hasRosetta() { return fmt.Errorf( - "%[1]s unsupported for %[2]s. Install Rosetta with `softwareupdate --install-rosetta` to use the available darwin-amd64 binary, or open an issue: `gh issue create -R %[3]s/%[1]s -t'Support %[2]s'`", - repo.RepoName(), platform, repo.RepoOwner()) + "%[1]s unsupported for %[2]s. Install Rosetta with `softwareupdate --install-rosetta` to use the available %[3]s binary, or open an issue: `gh issue create -R %[4]s/%[1]s -t'Support %[2]s'`", + repo.RepoName(), platform, darwinAmd64, repo.RepoOwner()) } + fallbackMessage := fmt.Sprintf("%[1]s not available for %[2]s. Falling back to compatible %[3]s binary", repo.RepoName(), platform, darwinAmd64) + fmt.Fprintln(m.io.Out, fallbackMessage) + asset = &a break } diff --git a/pkg/cmd/extension/manager_test.go b/pkg/cmd/extension/manager_test.go index 0ad8e991e..e25bc1496 100644 --- a/pkg/cmd/extension/manager_test.go +++ b/pkg/cmd/extension/manager_test.go @@ -1098,7 +1098,7 @@ func TestManager_Install_amd64_when_supported(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "FAKE BINARY", string(fakeBin)) - assert.Equal(t, "", stdout.String()) + assert.Equal(t, "gh-bin-ext not available for darwin-arm64. Falling back to compatible darwin-amd64 binary\n", stdout.String()) assert.Equal(t, "", stderr.String()) } From 029dc8ffc128361ac94b04414675089f3207f4f1 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Mon, 23 Sep 2024 09:04:03 -0700 Subject: [PATCH 10/22] Change conditional in promptForHostname to better reflect prompter changes The old isEnterprise check no longer makes sense, given the prompter is providing 'other', not 'GitHub Enterprise Server' as its non-GitHub.com option. Additionally, there was an opportunity for cleaning up the code via early returns and the removal of the default hostname lookup if we don't need it. --- pkg/cmd/auth/login/login.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 2a4f118cc..a25bd9f85 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -233,12 +233,10 @@ func promptForHostname(opts *LoginOptions) (string, error) { return "", err } - isEnterprise := hostType == 1 - - hostname := ghinstance.Default() - if isEnterprise { - hostname, err = opts.Prompter.InputHostname() + isGitHubDotCom := hostType == 0 + if isGitHubDotCom { + return ghinstance.Default(), nil } - return hostname, err + return opts.Prompter.InputHostname() } From f4af65d9dfb246ce8c3cbbd09f247917e34de3bd Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Mon, 23 Sep 2024 09:35:57 -0700 Subject: [PATCH 11/22] Update docs language to remove possible confusion around 'where you log in' --- pkg/cmd/auth/login/login.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index a25bd9f85..1480a29a0 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -59,7 +59,8 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm Long: heredoc.Docf(` Authenticate with a GitHub host. - The %[1]shostname%[1]s is where you log in to GitHub. The default hostname is %[1]sgithub.com%[1]s. + The default hostname is %[1]sgithub.com%[1]s. This can be overridden using the %[1]s--hostname%[1]s + flag. The default authentication mode is a web-based browser flow. After completion, an authentication token will be stored securely in the system credential store. From c843dddf0d7d5665fe01789cfa262c8efb80b653 Mon Sep 17 00:00:00 2001 From: Miroma <136986257+its-miroma@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:49:20 +0200 Subject: [PATCH 12/22] Add GPG key instructions to appropriate sections --- docs/install_linux.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/install_linux.md b/docs/install_linux.md index fabaa19aa..882ee3976 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -49,6 +49,9 @@ Alternatively, install from the [community repository](https://packages.fedorapr sudo dnf install gh ``` +> [!NOTE] +> If errors regarding GPG signatures occur, see [cli/cli#9569](https://github.com/cli/cli/issues/9569) for steps to fix this. + Upgrade: ```bash @@ -91,6 +94,9 @@ sudo zypper ref sudo zypper update gh ``` +> [!NOTE] +> If errors regarding GPG signatures occur, see [cli/cli#9569](https://github.com/cli/cli/issues/9569) for steps to fix this. + ## Manual installation * [Download release binaries][releases page] that match your platform; or From 4de63ac75b99e42ac6d2bd6504056c26335f5a2b Mon Sep 17 00:00:00 2001 From: Miroma <136986257+its-miroma@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:49:35 +0200 Subject: [PATCH 13/22] Include `dnf5` commands --- docs/install_linux.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/install_linux.md b/docs/install_linux.md index 882ee3976..9be6aed9b 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -43,6 +43,20 @@ sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.re sudo dnf install gh --repo gh-cli ``` +
+Show dnf5 commands + +If you're using `dnf5`, commands will vary slightly: + +```bash +sudo dnf5 install dnf5-plugins +sudo dnf5 config-manager addrepo --from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo +sudo dnf5 install gh --repo gh-cli +``` + +For more details, check out the [`dnf5 config-manager` documentation](https://dnf5.readthedocs.io/en/latest/dnf5_plugins/config-manager.8.html). +
+ Alternatively, install from the [community repository](https://packages.fedoraproject.org/pkgs/gh/gh/): ```bash From 0b29beacf45fa26aa7a9def1b89a29b106654b19 Mon Sep 17 00:00:00 2001 From: bagtoad <47394200+BagToad@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:47:24 -0600 Subject: [PATCH 14/22] Update docs to allow community submitted designs --- .github/CONTRIBUTING.md | 24 ++++++-- .../submit-a-design-proposal.md | 58 +++++++++++++++++++ docs/triage.md | 27 +++++---- 3 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/submit-a-design-proposal.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9f5d56376..5620dfadf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,16 +6,17 @@ We accept pull requests for bug fixes and features where we've discussed the app Please do: -* Check existing issues to verify that the [bug][bug issues] or [feature request][feature request issues] has not already been submitted. +* Check existing issues to verify that an [bug][bug issues] or [feature request][feature request issues] has not already been submitted for the same problem or feature. * Open an issue if things aren't working as expected. * Open an issue to propose a significant change. +* Open an issue to propose a design for an issue labelled [`needs-design` and `help wanted`][needs design and help wanted], following the [proposing a design guidelines](#proposing-a-design). * Open a pull request to fix a bug. * Open a pull request to fix documentation about a command. * Open a pull request for any issue labelled [`help wanted`][hw] or [`good first issue`][gfi]. Please avoid: -* Opening pull requests for issues marked `needs-design`, `needs-investigation`, or `blocked`. +* Opening pull requests for issues marked `needs-investigation`, or `blocked`. * Opening pull requests that haven't been approved for work in an issue * Adding installation instructions specifically for your OS/package manager. * Opening pull requests for any issue marked `core`. These issues require additional context from @@ -50,9 +51,23 @@ Please note that this project adheres to a [Contributor Code of Conduct][code-of We generate manual pages from source on every release. You do not need to submit pull requests for documentation specifically; manual pages for commands will automatically get updated after your pull requests gets accepted. -## Design guidelines +## Design guidelines -You may reference the [CLI Design System][] when suggesting features, and are welcome to use our [Google Docs Template][] to suggest designs. +### Proposing a design + +You may propose a design to solve an open bug or feature request issue that has both [the `needs-design` and `help-wanted` labels][needs design and help wanted]. + +To propose a design: + +- Open a new issue using the [design proposal issue template](./ISSUE_TEMPLATE/submit-a-design-proposal.md). +- Include a link to the issue that the design is for. +- Describe the design you are proposing to resolve the issue, leveraging the [CLI Design System][]. +- Mock up the design you are proposing using our [Google Docs Template][] or code blocks. + - Mock ups should cleary illustrate the command(s) being run and the expected output(s). + +### Revewing a design + +Maintainers will review the design proposal and provide feedback. Once a maintainer approves the design and adds the [`help wanted`][hw] label to the issue, a PR can be opened to provide the implementation. ## Resources @@ -62,6 +77,7 @@ You may reference the [CLI Design System][] when suggesting features, and are we [bug issues]: https://github.com/cli/cli/issues?q=is%3Aopen+is%3Aissue+label%3Abug +[needs design and help wanted]: https://github.com/cli/cli/issues?q=state%3Aclosed%20is%3Aissue%20label%3Aneeds-design%20label%3A%22help%20wanted%22 [feature request issues]: https://github.com/cli/cli/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement [hw]: https://github.com/cli/cli/labels/help%20wanted [gfi]: https://github.com/cli/cli/labels/good%20first%20issue diff --git a/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md b/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md new file mode 100644 index 000000000..0467ff77a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md @@ -0,0 +1,58 @@ +--- +name: "🎨 Submit a design proposal" +about: Submit a design to resolve an open issue that has both `needs-design` and `help-wanted` labels +title: '' +labels: enhancement +assignees: '' + +--- + + + +### Link to issue for design submission + + + +### Proposed Design + + + +### Mockup + + \ No newline at end of file diff --git a/docs/triage.md b/docs/triage.md index d78a81aed..67027b00e 100644 --- a/docs/triage.md +++ b/docs/triage.md @@ -33,27 +33,34 @@ the changeset is feasible and to allow the associated CI run for new contributor - can this be closed outright? - e.g. spam/junk + - add the `invalid` label - close without comment - do we not want to do it? - - e.g. have already discussed not wanting to do or duplicate issue + - e.g. we have already discussed not wanting to do or it's a duplicate issue + - add the appropriate label (e.g. `duplicate`) - comment and close -- are we ok with outside contribution for this? - - e.g. the task is relatively straightforward, but no people on our team have the bandwidth to take it on at the moment +- do we want outside contribution for this? + - e.g. the task is relatively straightforward, the core team does not have the bandwidth to take it on - ensure that the thread contains all the context necessary for someone new to pick this up - - add `help wanted` label + - add the `help wanted` label - consider adding `good first issue` label + - comment acknowledging that that we are accepting contributions for this and add any other details you feel may be necessary to complete the work +- do we want outside design contribution for this? + - e.g. the task is worthwhile, but needs design work to flesh out the details before implementation and the core team does not have the bandwidth to take it on + - ensure that the thread contains all the context necessary for someone new to pick this up + - add both the `help wanted` and `needs-design` labels + - comment acknowledging that that we are accepting contributions for this and add any other details you feel may be necessary to complete the work - do we want to do it? + - add the `core` label - comment acknowledging that - - add `core` label - - add to the project “TODO” column if this is something that should ship soon - is it intriguing, but requires discussion? - - label `discuss` - - label `needs-investigation` if engineering research is required before action can be taken + - Add the `discuss` label + - Add the `needs-investigation` label if engineering research is required before action can be taken - does it need more info from the issue author? - ask the user for details - - add `needs-user-input` label + - add the `needs-user-input` label - is it a usage/support question? - - consider converting the Issue to a Discussion + - Convert the Issue to a Discussion ## Weekly PR audit From aef01e22d7c375199fc838fde97730381807b6b0 Mon Sep 17 00:00:00 2001 From: bagtoad <47394200+BagToad@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:03:50 -0600 Subject: [PATCH 15/22] Revise wording --- .github/CONTRIBUTING.md | 4 ++-- docs/triage.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5620dfadf..2a3a09c13 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -65,9 +65,9 @@ To propose a design: - Mock up the design you are proposing using our [Google Docs Template][] or code blocks. - Mock ups should cleary illustrate the command(s) being run and the expected output(s). -### Revewing a design +### (core team only) Revewing a design -Maintainers will review the design proposal and provide feedback. Once a maintainer approves the design and adds the [`help wanted`][hw] label to the issue, a PR can be opened to provide the implementation. +A member of the core team will [triage](../docs/triage.md) the design proposal. Once a member of the core team has reviewd the design, they may add the [`help wanted`][hw] label to the issue, so a PR can be opened to provide the implementation. ## Resources diff --git a/docs/triage.md b/docs/triage.md index 67027b00e..d25d28c63 100644 --- a/docs/triage.md +++ b/docs/triage.md @@ -39,13 +39,13 @@ the changeset is feasible and to allow the associated CI run for new contributor - e.g. we have already discussed not wanting to do or it's a duplicate issue - add the appropriate label (e.g. `duplicate`) - comment and close -- do we want outside contribution for this? +- do we want external contribution for this? - e.g. the task is relatively straightforward, the core team does not have the bandwidth to take it on - ensure that the thread contains all the context necessary for someone new to pick this up - add the `help wanted` label - consider adding `good first issue` label - comment acknowledging that that we are accepting contributions for this and add any other details you feel may be necessary to complete the work -- do we want outside design contribution for this? +- do we want external design contribution for this? - e.g. the task is worthwhile, but needs design work to flesh out the details before implementation and the core team does not have the bandwidth to take it on - ensure that the thread contains all the context necessary for someone new to pick this up - add both the `help wanted` and `needs-design` labels From 7b8e8be7d45da6499168ec49356ba012881d67bb Mon Sep 17 00:00:00 2001 From: bagtoad <47394200+BagToad@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:13:19 -0600 Subject: [PATCH 16/22] Remove trailing space from heading --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2a3a09c13..c9a5f8dae 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -51,7 +51,7 @@ Please note that this project adheres to a [Contributor Code of Conduct][code-of We generate manual pages from source on every release. You do not need to submit pull requests for documentation specifically; manual pages for commands will automatically get updated after your pull requests gets accepted. -## Design guidelines +## Design guidelines ### Proposing a design From 89628a40f94e5177e5d02d8fab5a586f436fdb29 Mon Sep 17 00:00:00 2001 From: bagtoad <47394200+BagToad@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:13:43 -0600 Subject: [PATCH 17/22] fix typo --- docs/triage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/triage.md b/docs/triage.md index d25d28c63..90042263c 100644 --- a/docs/triage.md +++ b/docs/triage.md @@ -40,7 +40,7 @@ the changeset is feasible and to allow the associated CI run for new contributor - add the appropriate label (e.g. `duplicate`) - comment and close - do we want external contribution for this? - - e.g. the task is relatively straightforward, the core team does not have the bandwidth to take it on + - e.g. the task is relatively straightforward, but the core team does not have the bandwidth to take it on - ensure that the thread contains all the context necessary for someone new to pick this up - add the `help wanted` label - consider adding `good first issue` label From efe9841caf9ca58fd9d31441c70a18a8cff022a9 Mon Sep 17 00:00:00 2001 From: bagtoad <47394200+BagToad@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:14:59 -0600 Subject: [PATCH 18/22] Fix typo and wordsmithing --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c9a5f8dae..d7456873e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,7 +6,7 @@ We accept pull requests for bug fixes and features where we've discussed the app Please do: -* Check existing issues to verify that an [bug][bug issues] or [feature request][feature request issues] has not already been submitted for the same problem or feature. +* Check existing issues to verify that an existing [bug][bug issues] or [feature request][feature request issues] issue does not already exist for the same problem or feature. * Open an issue if things aren't working as expected. * Open an issue to propose a significant change. * Open an issue to propose a design for an issue labelled [`needs-design` and `help wanted`][needs design and help wanted], following the [proposing a design guidelines](#proposing-a-design). From 023a44904a9f1ddbb1866533e4d03048d040b456 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:02:54 -0600 Subject: [PATCH 19/22] Update SECURITY.md --- .github/SECURITY.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 15f909b71..50e489c54 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -2,7 +2,10 @@ GitHub takes the security of our software products and services seriously, inclu If you believe you have found a security vulnerability in GitHub CLI, you can report it to us in one of two ways: -* Report it to this repository directly using [private vulnerability reporting][]. Such reports are not eligible for a bounty reward. +* Report it to this repository directly using [private vulnerability reporting][]. + * Include a description of your investigation of the GitHub CLI's codebase and why you believe an exploit is possible. + * POCs and links to code are greatly encouraged. + * Such reports are not eligible for a bounty reward. * Submit the report through [HackerOne][] to be eligible for a bounty reward. From 29192daa23144479bf75c91173cc81e4ac52727b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:15:14 +0000 Subject: [PATCH 20/22] build(deps): bump github.com/theupdateframework/go-tuf/v2 Bumps [github.com/theupdateframework/go-tuf/v2](https://github.com/theupdateframework/go-tuf) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/theupdateframework/go-tuf/releases) - [Changelog](https://github.com/theupdateframework/go-tuf/blob/master/.goreleaser.yaml) - [Commits](https://github.com/theupdateframework/go-tuf/compare/v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: github.com/theupdateframework/go-tuf/v2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 42cfe7ff8..f4ef7989f 100644 --- a/go.mod +++ b/go.mod @@ -143,7 +143,7 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/theupdateframework/go-tuf v0.7.0 // indirect - github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect + github.com/theupdateframework/go-tuf/v2 v2.0.1 // indirect github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect github.com/transparency-dev/merkle v0.0.2 // indirect diff --git a/go.sum b/go.sum index 3b1fb2c2d..4f5689856 100644 --- a/go.sum +++ b/go.sum @@ -441,8 +441,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= -github.com/theupdateframework/go-tuf/v2 v2.0.0 h1:rD8d9RotYBprZVgC+9oyTZ5MmawepnTSTqoDuxjWgbs= -github.com/theupdateframework/go-tuf/v2 v2.0.0/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA= +github.com/theupdateframework/go-tuf/v2 v2.0.1 h1:11p9tXpq10KQEujxjcIjDSivMKCMLguls7erXHZnxJQ= +github.com/theupdateframework/go-tuf/v2 v2.0.1/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA= github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e h1:BuzhfgfWQbX0dWzYzT1zsORLnHRv3bcRcsaUk0VmXA8= github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e/go.mod h1:/Tnicc6m/lsJE0irFMA0LfIwTBo4QP7A8IfyIv4zZKI= github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0= From 289b9bc712027c391049e05a903acfe8727d67ae Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:24:23 -0600 Subject: [PATCH 21/22] Apply suggestions from code review Co-authored-by: Tyler McGoffin --- .github/CONTRIBUTING.md | 6 +++--- .github/ISSUE_TEMPLATE/submit-a-design-proposal.md | 2 +- docs/triage.md | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d7456873e..35b211236 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -9,14 +9,14 @@ Please do: * Check existing issues to verify that an existing [bug][bug issues] or [feature request][feature request issues] issue does not already exist for the same problem or feature. * Open an issue if things aren't working as expected. * Open an issue to propose a significant change. -* Open an issue to propose a design for an issue labelled [`needs-design` and `help wanted`][needs design and help wanted], following the [proposing a design guidelines](#proposing-a-design). +* Open an issue to propose a design for an issue labelled [`needs-design` and `help wanted`][needs design and help wanted], following the [proposing a design guidelines](#proposing-a-design) instructions below. * Open a pull request to fix a bug. * Open a pull request to fix documentation about a command. * Open a pull request for any issue labelled [`help wanted`][hw] or [`good first issue`][gfi]. Please avoid: -* Opening pull requests for issues marked `needs-investigation`, or `blocked`. +* Opening pull requests for issues marked `needs-design`, `needs-investigation`, or `blocked`. * Opening pull requests that haven't been approved for work in an issue * Adding installation instructions specifically for your OS/package manager. * Opening pull requests for any issue marked `core`. These issues require additional context from @@ -67,7 +67,7 @@ To propose a design: ### (core team only) Revewing a design -A member of the core team will [triage](../docs/triage.md) the design proposal. Once a member of the core team has reviewd the design, they may add the [`help wanted`][hw] label to the issue, so a PR can be opened to provide the implementation. +A member of the core team will [triage](../docs/triage.md) the design proposal. Once a member of the core team has reviewed the design, they may add the [`help wanted`][hw] label to the issue, so a PR can be opened to provide the implementation. ## Resources diff --git a/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md b/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md index 0467ff77a..fab4b7a88 100644 --- a/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md +++ b/.github/ISSUE_TEMPLATE/submit-a-design-proposal.md @@ -23,7 +23,7 @@ has both the `needs-design` and `help-wanted` labels. ### Mockup diff --git a/docs/triage.md b/docs/triage.md index 90042263c..9d54fcfe7 100644 --- a/docs/triage.md +++ b/docs/triage.md @@ -44,12 +44,10 @@ the changeset is feasible and to allow the associated CI run for new contributor - ensure that the thread contains all the context necessary for someone new to pick this up - add the `help wanted` label - consider adding `good first issue` label - - comment acknowledging that that we are accepting contributions for this and add any other details you feel may be necessary to complete the work - do we want external design contribution for this? - e.g. the task is worthwhile, but needs design work to flesh out the details before implementation and the core team does not have the bandwidth to take it on - ensure that the thread contains all the context necessary for someone new to pick this up - add both the `help wanted` and `needs-design` labels - - comment acknowledging that that we are accepting contributions for this and add any other details you feel may be necessary to complete the work - do we want to do it? - add the `core` label - comment acknowledging that From e6d39eb886610e7f74e76cc83085c5d96c8afd14 Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Mon, 6 Mar 2023 22:43:59 +0100 Subject: [PATCH 22/22] Print the login URL even when opening a browser Fixes https://github.com/cli/cli/issues/5500. --- internal/authflow/flow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authflow/flow.go b/internal/authflow/flow.go index 370e08784..3fc753b44 100644 --- a/internal/authflow/flow.go +++ b/internal/authflow/flow.go @@ -72,7 +72,7 @@ func AuthFlow(oauthHost string, IO *iostreams.IOStreams, notice string, addition return nil } - fmt.Fprintf(w, "%s to open %s in your browser... ", cs.Bold("Press Enter"), oauthHost) + fmt.Fprintf(w, "%s to open %s in your browser... ", cs.Bold("Press Enter"), authURL) _ = waitForEnter(IO.In) if err := b.Browse(authURL); err != nil {