DockerNaughty
DockerNaughty

Reputation: 303

Can i filter Github PRs with logical Negation operator?

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" 

Upvotes: 4

Views: 1645

Answers (1)

VonC
VonC

Reputation: 1329082

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"

Upvotes: 3

Related Questions