Filter PR's by the number of commits

I was just wondering why there’s no way to filter PR’s by the number of commits they have. There are search syntaxes for the number of comments, reactions and other odd things, but no syntax for filtering PR’s with the number of commits they have?
For reviewers/moderators who would want to search for large PR’s(having a lot of commits), so that they could review or merge the first few commits that look good is really important to managing contributions at scale.

1 Like

I’ve wondered that before (as someone who probably makes amongst the largest PRs by commit count).

Fwiw, it should be fairly easy to make an action to do this (and then people can filter by the labels).

There’s an action that I run into periodically that labels PRs by delta (not the same thing, but, it’s a base point):

conceptually, the work is something like:

commits=$(git log --oneline $GITHUB_BASE_REF..$GITHUB_HEAD_REF | wc -l)

n.b. I’d much prefer a GitHub native feature than to see people spend GitHub Workflow time units on an action for this.

1 Like