From 76f6aa1fc104bca8273b75be744b300d8f221a50 Mon Sep 17 00:00:00 2001 From: Alex Petrov Date: Sun, 12 Mar 2023 22:08:32 -0400 Subject: [PATCH] Clarify `gh auth refresh` command behavior (#7132) --- pkg/cmd/auth/refresh/refresh.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/auth/refresh/refresh.go b/pkg/cmd/auth/refresh/refresh.go index 28ce3520d..ab13e0552 100644 --- a/pkg/cmd/auth/refresh/refresh.go +++ b/pkg/cmd/auth/refresh/refresh.go @@ -58,8 +58,13 @@ func NewCmdRefresh(f *cmdutil.Factory, runF func(*RefreshOptions) error) *cobra. Short: "Refresh stored authentication credentials", Long: heredoc.Doc(`Expand or fix the permission scopes for stored credentials. - The --scopes flag accepts a comma separated list of scopes you want your gh credentials to have. If - absent, this command ensures that gh has access to a minimum set of scopes. + The --scopes flag accepts a comma separated list of scopes you want + your gh credentials to have. If no scopes are provided, the command + maintains previously added scopes. + + The command can only add additional scopes, but not remove previously + added ones. To reset scopes to the default minimum set of scopes, you + will need to create new credentials using the auth login command. `), Example: heredoc.Doc(` $ gh auth refresh --scopes write:org,read:public_key