From 375dbf19da99c17b6ce6a130794c4719de5c416d Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 2 Jan 2025 10:08:28 -0800 Subject: [PATCH 1/3] Add mention of classic token in gh auth login docs --- pkg/cmd/auth/login/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 8f35972c6..58cbe9038 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -63,7 +63,7 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm 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. + authentication token (classic) 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 %[1]sgh auth status%[1]s for its stored location. From ae9e68b80356f91e70fda69ee784efbe08ba78d5 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 2 Jan 2025 10:41:25 -0800 Subject: [PATCH 2/3] Move mention of classic token to correct line --- pkg/cmd/auth/login/login.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 58cbe9038..225c6ed06 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -63,14 +63,16 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm flag. The default authentication mode is a web-based browser flow. After completion, an - authentication token (classic) will be stored securely in the system credential store. + 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 %[1]sgh auth status%[1]s for its stored location. - Alternatively, use %[1]s--with-token%[1]s to pass in a token on standard input. + Alternatively, use %[1]s--with-token%[1]s to pass in a token (classic) on standard input. The minimum required scopes for the token are: %[1]srepo%[1]s, %[1]sread:org%[1]s, and %[1]sgist%[1]s. + Fine-grained tokens are not supported. + 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 %[1]sgh help environment%[1]s for more info. From aa793f1dac44bd4cfb4b209932993a7288476525 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 2 Jan 2025 14:22:20 -0800 Subject: [PATCH 3/3] Update pkg/cmd/auth/login/login.go Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com> --- 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 225c6ed06..ca165a22f 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -68,10 +68,10 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm to writing the token to a plain text file. See %[1]sgh auth status%[1]s for its stored location. - Alternatively, use %[1]s--with-token%[1]s to pass in a token (classic) on standard input. + Alternatively, use %[1]s--with-token%[1]s to pass in a personal access token (classic) on standard input. The minimum required scopes for the token are: %[1]srepo%[1]s, %[1]sread:org%[1]s, and %[1]sgist%[1]s. - Fine-grained tokens are not supported. + Fine-grained personal access tokens are not supported. 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