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

Julian Schmidt via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 08:32:36 PST 2023


================
@@ -211,6 +211,36 @@ 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
+        # by a user new to LLVM and/or GitHub itself.
+
+        # This text is using Markdown formatting.
+        comment = f"""\
+Thank you for submitting a Pull Request (PR) to the LLVM Project!
+
+You can add reviewers by using the "Reviewers" section on this page.
----------------
5chmidti wrote:

Or might this be obvious by the time the action ran, because the labeling and team ping already happened?

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


More information about the llvm-commits mailing list