-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
coreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLIgh-prrelating to the gh pr commandrelating to the gh pr command
Description
Describe the bug
gh pr list only supports the --head <branch> syntax but not --head <owner>:<branch>.
Meanwhile, gh pr create --head <owner>:<branch> is supported since v2.71.0 (added by #10513 in fixing #575).
Need to check other options which accept a branch name.
https://cli.github.com/manual/gh_pr_list
https://cli.github.com/manual/gh_pr_create
Affected version
gh version 2.72.0 (2025-04-30)
https://github.com/cli/cli/releases/tag/v2.72.0
Steps to reproduce the behavior
--head "typos" finds two closed PRs in latex3/latex repository.
$ GH_PAGER="" gh -R latex3/latex3 pr list --state all --head "typos"
Showing 2 of 2 pull requests in latex3/latex3 that match your search
ID TITLE BRANCH CREATED AT
#1610 fix small typos mbertucci47:typos about 6 months ago
#392 Typos in the intro to the l3tl documentation EvanAad:typos about 7 years ago
But when specific owner name is provided (`--head ":typos"), no PR is found.
$ GH_PAGER="" gh -R latex3/latex3 pr list --state all --head "mbertucci47:typos"
no pull requests match your search in latex3/latex3
$ GH_PAGER="" gh -R latex3/latex3 pr list --state all --head "EvanAad:typos"
no pull requests match your search in latex3/latex3
Logs
Adding GH_DEBUG=api, it seems the only useful info is that the <owner>:<branch> was correctly passed on to GraphQL variables
$ GH_DEBUG=api GH_PAGER="" gh -R latex3/latex3 pr list --state all --head "mbertucci47:typos"
[...]
GraphQL variables: {"headBranch":"mbertucci47:typos","limit":30,"owner":"latex3","repo":"latex3","state":["OPEN","CLOSED","MERGED"]}
[...]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLIgh-prrelating to the gh pr commandrelating to the gh pr command