ci(slash-cmd): allow repo write-permission users to /rerun-ut (#21120)

This commit is contained in:
Liangsheng Yin
2026-03-22 00:32:29 -07:00
committed by GitHub
parent 3bc595acbc
commit 1e97864d75

View File

@@ -711,6 +711,19 @@ def main():
user_perms["can_rerun_failed_ci"] = True
user_perms["can_rerun_ut"] = True
# Users with write (or higher) permission on the repo can rerun UTs on any PR,
# even if they are not the PR author or listed in CI_PERMISSIONS.json.
if not user_perms or not user_perms.get("can_rerun_ut", False):
perm = repo.get_collaborator_permission(user_login)
if perm in ("admin", "write"):
print(
f"User {user_login} has '{perm}' repo permission. "
"Granting can_rerun_ut."
)
if user_perms is None:
user_perms = {}
user_perms["can_rerun_ut"] = True
if not user_perms:
print(f"User {user_login} does not have any configured permissions. Exiting.")
return