Skip to content

Commit

Permalink
dev-cmd/contributions: Only count approving reviews
Browse files Browse the repository at this point in the history
- The `reviewed-by` filter retrieved all reviews for a user, including
  those they'd added to their own PRs. Since it's impossible to click
  the "approve" button on one's own PR, filter this to `review:approved`
  to get "further project goals" kinds of reviews.
- Suggested in Homebrew#14813 (comment).
  • Loading branch information
issyl0 committed Feb 28, 2023
1 parent eeadcc8 commit b8b7e63
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Library/Homebrew/dev-cmd/contributions.rb
Expand Up @@ -172,7 +172,14 @@ def scan_repositories(repos, person, args)
data[repo] = {
commits: GitHub.repo_commit_count_for_user(repo_full_name, person, args),
coauthorships: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", args),
reviews: GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, args: args),
reviews: GitHub.count_issues(
"",
is: "pr",
repo: repo_full_name,
reviewed_by: person,
review: "approved",
args: args,
),
}
end

Expand Down

0 comments on commit b8b7e63

Please sign in to comment.