From b14da6c63fe243efead026920ce7e720c01a77cd Mon Sep 17 00:00:00 2001 From: Yukai Chou Date: Thu, 23 Nov 2023 07:22:57 +0800 Subject: [PATCH] Wrap scopes --- pkg/cmd/auth/login/login.go | 2 +- pkg/cmd/auth/refresh/refresh.go | 2 +- pkg/cmd/issue/create/create.go | 2 +- pkg/cmd/issue/edit/edit.go | 2 +- pkg/cmd/pr/create/create.go | 2 +- pkg/cmd/pr/edit/edit.go | 2 +- pkg/cmd/ruleset/list/list.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index d792e0013..7fe728b09 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 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. - The minimum required scopes for the token are: "repo", "read:org". + The minimum required scopes for the token are: %[1]srepo%[1]s, %[1]sread:org%[1]s. 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 diff --git a/pkg/cmd/auth/refresh/refresh.go b/pkg/cmd/auth/refresh/refresh.go index a74bd18fb..2335a9952 100644 --- a/pkg/cmd/auth/refresh/refresh.go +++ b/pkg/cmd/auth/refresh/refresh.go @@ -68,7 +68,7 @@ func NewCmdRefresh(f *cmdutil.Factory, runF func(*RefreshOptions) error) *cobra. The %[1]s--remove-scopes%[1]s flag accepts a comma separated list of scopes you want to remove from your gh credentials. Scope removal is idempotent. - The minimum set of scopes ("repo", "read:org" and "gist") cannot be removed. + The minimum set of scopes (%[1]srepo%[1]s, %[1]sread:org%[1]s, and %[1]sgist%[1]s) cannot be removed. The %[1]s--reset-scopes%[1]s flag resets the scopes for your gh credentials to the default set of scopes for your auth flow. diff --git a/pkg/cmd/issue/create/create.go b/pkg/cmd/issue/create/create.go index 39fc21842..9aa0fffa8 100644 --- a/pkg/cmd/issue/create/create.go +++ b/pkg/cmd/issue/create/create.go @@ -59,7 +59,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co Long: heredoc.Docf(` Create an issue on GitHub. - Adding an issue to projects requires authorization with the "project" scope. + Adding an issue to projects requires authorization with the %[1]sproject%[1]s scope. To authorize, run %[1]sgh auth refresh -s project%[1]s. `, "`"), Example: heredoc.Doc(` diff --git a/pkg/cmd/issue/edit/edit.go b/pkg/cmd/issue/edit/edit.go index 3e85813f6..1b775f88b 100644 --- a/pkg/cmd/issue/edit/edit.go +++ b/pkg/cmd/issue/edit/edit.go @@ -53,7 +53,7 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman Long: heredoc.Docf(` Edit one or more issues within the same repository. - Editing issues' projects requires authorization with the "project" scope. + Editing issues' projects requires authorization with the %[1]sproject%[1]s scope. To authorize, run %[1]sgh auth refresh -s project%[1]s. `, "`"), Example: heredoc.Doc(` diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index cecc32fe0..21cb41964 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -118,7 +118,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co By default, users with write access to the base repository can push new commits to the head branch of the pull request. Disable this with %[1]s--no-maintainer-edit%[1]s. - Adding a pull request to projects requires authorization with the "project" scope. + Adding a pull request to projects requires authorization with the %[1]sproject%[1]s scope. To authorize, run %[1]sgh auth refresh -s project%[1]s. `, "`"), Example: heredoc.Doc(` diff --git a/pkg/cmd/pr/edit/edit.go b/pkg/cmd/pr/edit/edit.go index 502b1b384..d0dbcfbc2 100644 --- a/pkg/cmd/pr/edit/edit.go +++ b/pkg/cmd/pr/edit/edit.go @@ -53,7 +53,7 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman Without an argument, the pull request that belongs to the current branch is selected. - Editing a pull request's projects requires authorization with the "project" scope. + Editing a pull request's projects requires authorization with the %[1]sproject%[1]s scope. To authorize, run %[1]sgh auth refresh -s project%[1]s. `, "`"), Example: heredoc.Doc(` diff --git a/pkg/cmd/ruleset/list/list.go b/pkg/cmd/ruleset/list/list.go index f9c8f4880..7cc533e13 100644 --- a/pkg/cmd/ruleset/list/list.go +++ b/pkg/cmd/ruleset/list/list.go @@ -50,7 +50,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Use the %[1]s--parents%[1]s flag to control whether rulesets configured at higher levels that also apply to the provided repository or organization should be returned. The default is %[1]strue%[1]s. - Your access token must have the "admin:org" scope to use the %[1]s--org%[1]s flag, which can be granted by running %[1]sgh auth refresh -s admin:org%[1]s. + Your access token must have the %[1]sadmin:org%[1]s scope to use the %[1]s--org%[1]s flag, which can be granted by running %[1]sgh auth refresh -s admin:org%[1]s. `, "`"), Example: heredoc.Doc(` # List rulesets in the current repository