From 63ad804a2654c7e3e081d293729a215b6687cce5 Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Tue, 24 Jan 2023 09:22:20 -0800 Subject: [PATCH] Add notes about project scope to various commands (#6907) --- pkg/cmd/issue/create/create.go | 6 ++++++ pkg/cmd/issue/edit/edit.go | 6 ++++++ pkg/cmd/pr/create/create.go | 3 +++ pkg/cmd/pr/edit/edit.go | 3 +++ 4 files changed, 18 insertions(+) diff --git a/pkg/cmd/issue/create/create.go b/pkg/cmd/issue/create/create.go index 081e55b20..9e14760f5 100644 --- a/pkg/cmd/issue/create/create.go +++ b/pkg/cmd/issue/create/create.go @@ -55,6 +55,12 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co cmd := &cobra.Command{ Use: "create", Short: "Create a new issue", + Long: heredoc.Doc(` + Create an issue on GitHub. + + Adding an issue to projects requires authorization with the "project" scope. + To authorize, run "gh auth refresh -s project". + `), Example: heredoc.Doc(` $ gh issue create --title "I found a bug" --body "Nothing works" $ gh issue create --label "bug,help wanted" diff --git a/pkg/cmd/issue/edit/edit.go b/pkg/cmd/issue/edit/edit.go index 4df0b6c8b..abea9eaae 100644 --- a/pkg/cmd/issue/edit/edit.go +++ b/pkg/cmd/issue/edit/edit.go @@ -45,6 +45,12 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman cmd := &cobra.Command{ Use: "edit { | }", Short: "Edit an issue", + Long: heredoc.Doc(` + Edit an issue. + + Editing an issue's projects requires authorization with the "project" scope. + To authorize, run "gh auth refresh -s project". + `), Example: heredoc.Doc(` $ gh issue edit 23 --title "I found a bug" --body "Nothing works" $ gh issue edit 23 --add-label "bug,help wanted" --remove-label "core" diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 3248e485d..28fa807ed 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -110,6 +110,9 @@ 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. + To authorize, run "gh auth refresh -s project". `, "`"), Example: heredoc.Doc(` $ gh pr create --title "The bug is fixed" --body "Everything works again" diff --git a/pkg/cmd/pr/edit/edit.go b/pkg/cmd/pr/edit/edit.go index 3a65f7c1d..d4a9a32b5 100644 --- a/pkg/cmd/pr/edit/edit.go +++ b/pkg/cmd/pr/edit/edit.go @@ -50,6 +50,9 @@ 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. + To authorize, run "gh auth refresh -s project". `), Example: heredoc.Doc(` $ gh pr edit 23 --title "I found a bug" --body "Nothing works"