Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up`gh pr list --state closed` returns `MERGED` #1809
Comments
|
Sorry, this is by design! We wanted to reflect the web UI as much as possible, and there "closed" also includes "merged": https://github.com/cli/cli/pulls?q=is%3Apr+is%3Aclosed How could we make this clearer? I'm guessing you really need a true |
|
Thanks for the quick response. :TIL: closed includes merged. Makes sense. TL;DR: adding What I'm really looking for, is exposing the data web UI does at I'd like to clean up my branches - getting rid of ones that were associated with PRs that were closed or merged, and ones that are very old. The "associated with merged PRs" was easy with the new I know some of this can be done with just |
|
@rynop I see! Thanks; that's valuable insight. For now you can request the PR list manually via the API: gh api -XGET repos/:owner/:repo/pulls -f state=closed -f per_page=100 | \
jq -r '.[] | [.number,.title,.state,.head.label] | @tsv'This will return true |
Actually I don't think it returns true |
Describe the bug
gh pr list --state closedreturns PRs inMERGEDstate. Same output as if you ran thegh pr list --state mergedcommand.Steps to reproduce the behavior
gh pr list --state closed | grep -i mergedMERGEDPRsExpected vs actual behavior
Expect to see only a list of PRs in the
closedstateLogs