From 2bb95969b74685ca2e12857b5a8bce1a253353cf Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Sun, 13 Jun 2021 15:59:15 -0700 Subject: [PATCH] Fixed issue with wrong name referencing from github api (#677) --- .github/scripts/build_assets/api_handler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/build_assets/api_handler.py b/.github/scripts/build_assets/api_handler.py index dcf2d1d2a..a1f8c5dc9 100644 --- a/.github/scripts/build_assets/api_handler.py +++ b/.github/scripts/build_assets/api_handler.py @@ -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)])