Skip to content

Commit 2bb9596

Browse files
authored
Fixed issue with wrong name referencing from github api (#677)
1 parent 794e859 commit 2bb9596

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/scripts/build_assets/api_handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ def find_all_authors(pull_req_data, token):
6363
commits = response.json()
6464
authors = set() # want unique authors only
6565
for commit in commits:
66-
authors.add(commit["commit"]["author"]["name"])
66+
try:
67+
# this contains proper referenceable github name
68+
authors.add(commit["author"]["login"])
69+
except TypeError:
70+
# special case
71+
authors.add(commit["commit"]["author"]["name"])
72+
print(f"This URL didn't have an `author` attribute: {pull_req_data['commits_url']}")
6773
return ", ".join(["@" + author for author in list(authors)])
6874

6975

0 commit comments

Comments
 (0)