File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/customizable_continuous_integration/automations/commands Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 8
8
03/09/2024 Ryan, Gao Initial creation
9
9
17/09/2024 Ryan, Gao Add cross-forks check
10
10
30/09/2024 Ryan, Gao Add support to use repo admin
11
+ 04/10/2024 Ryan, Gao Add maintainers into the admin list
11
12
"""
12
13
13
14
import argparse
22
23
from pre_commit .util import CalledProcessError , cmd_output
23
24
24
25
from customizable_continuous_integration .common_libs .github_apis import repository
26
+
25
27
FORKED_REPOSITORY_REMOTE_NAME = "downstream"
26
28
29
+
27
30
def get_integration_test_logger () -> logging .Logger :
28
31
_logger = logging .getLogger ("write_protection_hook" )
29
32
logging_ch = logging .StreamHandler (sys .stdout )
@@ -83,7 +86,8 @@ def write_protection_command(cli_args: list[str]) -> None:
83
86
head_ref = f"{ FORKED_REPOSITORY_REMOTE_NAME } /{ head_ref } "
84
87
admin_list = args .admin_list
85
88
if args .github_access_token and args .github_repository_name :
86
- admins = repository .get_repository_by_permission (args .github_access_token , args .github_repository_name , "admin" )
89
+ admins = repository .get_repository_by_permission (args .github_access_token , args .github_repository_name , "maintain" )
90
+ admins = list (set (admins ))
87
91
if admin_list :
88
92
admins .append (admin_list )
89
93
admin_list = ";" .join (admins )
You can’t perform that action at this time.
0 commit comments