1
0
mirror of https://github.com/konpa/devicon.git synced 2025-03-13 17:29:42 +01:00

Fixed issue with wrong name referencing from github api (#677)

This commit is contained in:
Thomas Bui 2021-06-13 15:59:15 -07:00 committed by GitHub
parent 794e8592ba
commit 2bb95969b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,13 @@ def find_all_authors(pull_req_data, token):
commits = response.json()
authors = set() # want unique authors only
for commit in commits:
authors.add(commit["commit"]["author"]["name"])
try:
# this contains proper referenceable github name
authors.add(commit["author"]["login"])
except TypeError:
# special case
authors.add(commit["commit"]["author"]["name"])
print(f"This URL didn't have an `author` attribute: {pull_req_data['commits_url']}")
return ", ".join(["@" + author for author in list(authors)])