[llvm] e0a3964 - workflows: Fix error when searching for backport reviewers

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 01:09:59 PDT 2022


Author: Tom Stellard
Date: 2022-08-02T01:09:02-07:00
New Revision: e0a3964affe82a63702e231c84be535d39413d1b

URL: https://github.com/llvm/llvm-project/commit/e0a3964affe82a63702e231c84be535d39413d1b
DIFF: https://github.com/llvm/llvm-project/commit/e0a3964affe82a63702e231c84be535d39413d1b.diff

LOG: workflows: Fix error when searching for backport reviewers

Added: 
    

Modified: 
    llvm/utils/git/github-automation.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index f1ce69df1f1a8..5225682f25082 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -86,7 +86,13 @@ def phab_login_to_github_login(phab_token:str, repo:github.Repository.Repository
         return None
 
     commit_sha = data[0]['fields']['identifier']
-    return repo.get_commit(commit_sha).committer.login
+    committer = repo.get_commit(commit_sha).committer
+    if not committer:
+        # This committer had an email address GitHub could not recognize, so
+        # it can't link the user to a GitHub account.
+        print(f"Warning: Can't find github account for {phab_login}")
+        return None
+    return committer.login
 
 def phab_get_commit_approvers(phab_token:str, repo:github.Repository.Repository, commit:github.Commit.Commit) -> list:
     args = { "corpus" : commit.commit.message }


        


More information about the llvm-commits mailing list