Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i filter Github PRs with logical Negation operator?

Tags:

github

Tried a lot of searching in Github docs and also stackoverflow. Couldn't find a descent example to show how we can filter PRs with logical negation operator

Let's say I want to filter all the PRs which are closed and does not have AutoDeploy in title.

Tried the following but it does not work.

is:pr is:closed -in:title "AutoDeploy" 
like image 793
DockerNaughty Avatar asked Sep 03 '25 17:09

DockerNaughty


1 Answers

From "Understanding the search syntax", you can indeed prefix any search qualifier with a - to exclude all results that are matched by that qualifier.

However, that seems to apply to repository search only, not issue and PR search, where the exclusion operator does nothing on the 'in' qualifier.

You might need to list all pr, and then subtract the one with AutoDeploy (or grep -v to exclude them)

Using the GitHub CLI command gh pr list can help post-processing the results.

gh pr list --search "is:closed" | grep -v "AutoDeploy"
like image 52
VonC Avatar answered Sep 07 '25 19:09

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!