[llvm] [GitHub][workflows] Ask reviewers to merge PRs when author can not (PR #81142)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 12:59:10 PST 2024


================
@@ -298,6 +299,76 @@ def run(self) -> bool:
         return True
 
 
+class PRMergeOnBehalfInformation:
+    COMMENT_TAG = "<!--LLVM MERGE ON BEHALF INFORMATION COMMENT-->\n"
+
+    def __init__(self, token: str, repo: str, pr_number: int, author: str):
+        repo = github.Github(token).get_repo(repo)
+        self.pr = repo.get_issue(pr_number).as_pull_request()
+        self.author = author
+        self.repo = repo
+        self.token = token
+
+    def author_has_push_permission(self):
+        # https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user
+        response = requests.get(
----------------
boomanaiden154 wrote:

Are we not able to get this information through the `github` library? The documentation is usually buried, but they have had all the endpoints exposed that I've needed.

https://github.com/llvm/llvm-project/pull/81142


More information about the llvm-commits mailing list