dev-cmd/contributions: Only count approving reviews

- 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 https://github.com/Homebrew/brew/pull/14813#discussion_r1118696385.
This commit is contained in:
Issy Long 2023-02-27 13:03:56 +00:00
parent eeadcc8ded
commit b8b7e6350d
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -172,7 +172,14 @@ module Homebrew
data[repo] = { data[repo] = {
commits: GitHub.repo_commit_count_for_user(repo_full_name, person, args), 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), 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 end