@@ -93,7 +93,7 @@ def is_engineering_project(repo):
93
93
94
94
95
95
def load_branch_protection_config ():
96
- with open (' branch_protections.yaml' , 'r' ) as file :
96
+ with open (" branch_protections.yml" , "r" ) as file :
97
97
config = yaml .safe_load (file )
98
98
return config
99
99
@@ -108,12 +108,9 @@ def update_branch_protection(repo):
108
108
else :
109
109
raise
110
110
config = load_branch_protection_config ()
111
- exempt_repositories = config ['EXEMPT_REPOSITORIES' ]
112
- required_status_check_map = config ['REQUIRED_STATUS_CHECK_MAP' ]
113
- if (
114
- repo .name not in exempt_repositories
115
- and is_engineering_project (repo )
116
- ):
111
+ exempt_repositories = config ["EXEMPT_REPOSITORIES" ]
112
+ required_status_check_map = config ["REQUIRED_STATUS_CHECK_MAP" ]
113
+ if repo .name not in exempt_repositories and is_engineering_project (repo ):
117
114
LOG .info (f"{ repo .name } : updating branch protections" )
118
115
# The following empty *_bypass_pull_request_allowance arguments ensure
119
116
# the required bypass_pull_request_allowances API parameter is
@@ -123,9 +120,7 @@ def update_branch_protection(repo):
123
120
default_branch .edit_protection (
124
121
required_approving_review_count = 1 ,
125
122
user_push_restrictions = [],
126
- contexts = required_status_check_map [
127
- repo .name
128
- ],
123
+ contexts = required_status_check_map [repo .name ],
129
124
users_bypass_pull_request_allowances = [],
130
125
teams_bypass_pull_request_allowances = [],
131
126
apps_bypass_pull_request_allowances = [],
0 commit comments