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

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 08:43:51 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.
----------------
DavidSpickett wrote:

A note is a good idea regardless, but as it stands, there's no explicit ordering of the jobs. This could finish before or after the labeller.

Maybe it would be better to include this workflow as the first job as the labeler (`.github/workflows/new-prs.yml`) and have the labeler depend on that job having run (or been skipped). Then we would always have greeting (or not) - labelling - subscribers.

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


More information about the llvm-commits mailing list