From 077f064f4a360600061db0f2a93553641a4ce053 Mon Sep 17 00:00:00 2001 From: Michael Hoffman Date: Wed, 29 Jan 2025 10:21:11 -0500 Subject: [PATCH 1/4] Remove v1 project 'add to board' automation from prauto workflow --- .github/workflows/prauto.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/prauto.yml b/.github/workflows/prauto.yml index 2596fa76c..67602b2ee 100644 --- a/.github/workflows/prauto.yml +++ b/.github/workflows/prauto.yml @@ -43,26 +43,12 @@ jobs: -q ".data.repository.project.columns.nodes[] | select(.name | startswith(\"$1\")) | .id" } - addToBoard () { - gh api graphql --silent -f query=' - mutation($colID:ID!, $prID:ID!) { addProjectCard(input: { projectColumnId: $colID, contentId: $prID }) { clientMutationId } } - ' -f colID="$(colID "Needs review")" -f prID="$PRID" - } - if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null then if [ "$PR_AUTHOR_TYPE" != "Bot" ] then gh pr edit $PRNUM --add-assignee $PRAUTHOR fi - if ! errtext="$(addToBoard 2>&1)" - then - cat <<<"$errtext" >&2 - if ! grep -iq 'project already has the associated issue' <<<"$errtext" - then - exit 1 - fi - fi exit 0 fi @@ -86,5 +72,4 @@ jobs: commentPR "Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message." fi - addToBoard exit 0 From 9e14550f11bb6408e95a6f96535770d03dc539ad Mon Sep 17 00:00:00 2001 From: Azeem Sajid Date: Thu, 30 Jan 2025 10:21:18 +0500 Subject: [PATCH 2/4] [gh api] Fix mutual exclusion messages of `--slurp` flag --- pkg/cmd/api/api.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/cmd/api/api.go b/pkg/cmd/api/api.go index c8eac9115..a6eb69718 100644 --- a/pkg/cmd/api/api.go +++ b/pkg/cmd/api/api.go @@ -239,17 +239,19 @@ func NewCmdApi(f *cmdutil.Factory, runF func(*ApiOptions) error) *cobra.Command return err } - if opts.Slurp && !opts.Paginate { - return cmdutil.FlagErrorf("`--paginate` required when passing `--slurp`") - } + if opts.Slurp { + if err := cmdutil.MutuallyExclusive( + "the `--slurp` option is not supported with `--jq` or `--template`", + opts.Slurp, + opts.FilterOutput != "", + opts.Template != "", + ); err != nil { + return err + } - if err := cmdutil.MutuallyExclusive( - "the `--slurp` option is not supported with `--jq` or `--template`", - opts.Slurp, - opts.FilterOutput != "", - opts.Template != "", - ); err != nil { - return err + if !opts.Paginate { + return cmdutil.FlagErrorf("`--paginate` required when passing `--slurp`") + } } if err := cmdutil.MutuallyExclusive( From 978d3fce87d2178e64b9cc9f9d363dc474ffcb45 Mon Sep 17 00:00:00 2001 From: Azeem Sajid Date: Thu, 30 Jan 2025 13:05:18 +0500 Subject: [PATCH 3/4] [gh issue/pr list] Improve help text --- pkg/cmd/issue/list/list.go | 3 ++- pkg/cmd/pr/list/list.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/issue/list/list.go b/pkg/cmd/issue/list/list.go index 47da51ae4..46c0e2cb0 100644 --- a/pkg/cmd/issue/list/list.go +++ b/pkg/cmd/issue/list/list.go @@ -59,7 +59,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Use: "list", Short: "List issues in a repository", Long: heredoc.Doc(` - List issues in a GitHub repository. + List issues in a GitHub repository. By default, this only lists open issues. The search query syntax is documented here: @@ -70,6 +70,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman $ gh issue list --assignee "@me" $ gh issue list --milestone "The big 1.0" $ gh issue list --search "error no:assignee sort:created-asc" + $ gh issue list --state all `), Aliases: []string{"ls"}, Args: cmdutil.NoArgsQuoteReminder, diff --git a/pkg/cmd/pr/list/list.go b/pkg/cmd/pr/list/list.go index 93a9b8b4b..bf0c2f8ed 100644 --- a/pkg/cmd/pr/list/list.go +++ b/pkg/cmd/pr/list/list.go @@ -55,7 +55,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman Use: "list", Short: "List pull requests in a repository", Long: heredoc.Doc(` - List pull requests in a GitHub repository. + List pull requests in a GitHub repository. By default, this only lists open PRs. The search query syntax is documented here: From d1b5facb48f11d95af08b12b4697f342ce8db025 Mon Sep 17 00:00:00 2001 From: Michael Hoffman Date: Thu, 30 Jan 2025 12:59:29 -0500 Subject: [PATCH 4/4] Remove unused env var, PRID --- .github/workflows/prauto.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/prauto.yml b/.github/workflows/prauto.yml index 67602b2ee..b7ed90183 100644 --- a/.github/workflows/prauto.yml +++ b/.github/workflows/prauto.yml @@ -16,7 +16,6 @@ jobs: env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }} - PRID: ${{ github.event.pull_request.node_id }} PRBODY: ${{ github.event.pull_request.body }} PRNUM: ${{ github.event.pull_request.number }} PRHEAD: ${{ github.event.pull_request.head.label }}