Skip to content

Commit c5c3fcd

Browse files
authored
Merge pull request #168 from jepler/weblate-author-credit
gather_insights: if weblate created a PR, name all authors inside
2 parents 3f1738d + 27c5af2 commit c5c3fcd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

adabot/lib/circuitpython_library_validators.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,17 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
882882
)
883883
insights["merged_prs"].append(pr_link)
884884

885-
insights["pr_merged_authors"].add(pr_info["user"]["login"])
885+
pr_author = pr_info["user"]["login"]
886+
if pr_author == "weblate":
887+
pr_commits = github.get(str(pr_info["url"]) + "/commits")
888+
if pr_commits.ok:
889+
for commit in pr_commits.json():
890+
author = commit.get("author")
891+
if author:
892+
insights["pr_merged_authors"].add(author["login"])
893+
else:
894+
insights["pr_merged_authors"].add(pr_info["user"]["login"])
895+
886896
insights["pr_reviewers"].add(pr_info["merged_by"]["login"])
887897
pr_reviews = github.get(str(pr_info["url"]) + "/reviews")
888898
if pr_reviews.ok:

0 commit comments

Comments
 (0)