diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2024-07-31 18:54:02 -0400 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-05 19:30:26 +0000 |
commit | 09ad1a00729d53ba06e7f441eefc6fa364b10059 (patch) | |
tree | b90a546f37f491f5787390373c63baa640650ffa | |
parent | e86647decda974aff8a4356f67adc730eddea111 (diff) | |
download | edk2-09ad1a00729d53ba06e7f441eefc6fa364b10059.tar.gz edk2-09ad1a00729d53ba06e7f441eefc6fa364b10059.tar.bz2 edk2-09ad1a00729d53ba06e7f441eefc6fa364b10059.zip |
.github/request-reviews.yml: Add non-collab admin notification
If a non-collaborator is part of the reviewer list, an admin needs
to be notified so they can be removed.
This change finds the list of admins for the repo and notifies them
in the comment left on the PR describing the list of non-collaborator
users. The message itself is cleaned up to show only the
non-collaborator users for ease of identification.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r-- | .github/scripts/GitHub.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/.github/scripts/GitHub.py b/.github/scripts/GitHub.py index bc0f355206..5db2060ca9 100644 --- a/.github/scripts/GitHub.py +++ b/.github/scripts/GitHub.py @@ -221,16 +221,29 @@ def add_reviewers_to_pr( f"::error title=User is not a Collaborator!::{', '.join(non_collaborators)}"
)
+ repo_admins = [
+ a.login for a in repo_gh.get_collaborators(permission="admin")
+ ]
+
leave_pr_comment(
token,
owner,
repo,
pr_number,
- f"⚠ **WARNING: Cannot add reviewers**: A user specified as a "
- f"reviewer for this PR is not a collaborator "
- f"of the edk2 repository. Please add them as a collaborator to the "
- f"repository and re-request the review.\n\n"
- f"Users requested:\n{', '.join(user_names)}",
+ f"⚠ **WARNING: Cannot add some reviewers**: A user "
+ f"specified as a reviewer for this PR is not a collaborator "
+ f"of the repository. Please add them as a collaborator to "
+ f"the repository so they can be requested in the future.\n\n"
+ f"Non-collaborators requested:\n"
+ f"{'\n'.join([f'- @{c}' for c in non_collaborators])}"
+ f"\n\nAttn Admins:\n"
+ f"{'\n'.join([f'- @{a}' for a in repo_admins])}\n---\n"
+ f"**Admin Instructions:**\n"
+ f"- Add the non-collaborators as collaborators to the "
+ f"appropriate team(s) listed in "
+ f"[teams](https://github.com/orgs/tianocore/teams)\n"
+ f"- If they are no longer needed as reviewers, remove them "
+ f"from [`Maintainers.txt`](https://github.com/tianocore/edk2/blob/HEAD/Maintainers.txt)",
)
# Add any new reviewers to the PR if needed.
|