[llvm] [GitHub] Add Greeting comment to new PRs with useful information (PR #72249)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 06:27:35 PST 2023


================
@@ -211,6 +211,35 @@ def _get_curent_team(self) -> Optional[github.Team.Team]:
         return None
 
 
+class PRGreeter:
+    def __init__(self, token: str, repo: str, pr_number: int):
+        repo = github.Github(token).get_repo(repo)
+        self.pr = repo.get_issue(pr_number).as_pull_request()
+
+    def run(self) -> bool:
+        # We assume that this is only called for a PR that has just been opened.
+
+        # This text is using Markdown formatting.
+        comment = f"""\
----------------
tstellar wrote:

I like this comment content. The question is do we want to add this to every pull request or do we want to only use it on certain pull requests, like from new contributors.

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


More information about the llvm-commits mailing list