4343OWNER = "ClangBuiltLinux"
4444REPO = "continuous-integration2"
4545MAIN_BRANCH = "main"
46- HEADERS = {} # populated after args are parsed
46+ headers = {} # populated after args are parsed
4747
4848# states we allow our cache system to perform a cache-hit upon
4949# other states like 'presuite' or 'unknown' or '' (empty) are considered
@@ -94,7 +94,7 @@ def ___purge___cache___():
9494 """!!!completely clears the CBL CI cache!!!"""
9595 list_url = f"https://api.github.com/repos/{ OWNER } /{ REPO } /actions/variables"
9696
97- list_response = requests .get (list_url , headers = HEADERS , timeout = TIMEOUT )
97+ list_response = requests .get (list_url , headers = headers , timeout = TIMEOUT )
9898 print (list_response .content )
9999 all_variables_keys = [
100100 x ["name" ] for x in json .loads (list_response .content )["variables" ]
@@ -106,7 +106,7 @@ def ___purge___cache___():
106106 f"https://api.github.com/repos/{ OWNER } /{ REPO } /actions/variables/{ key } "
107107 )
108108 delete_response = requests .delete (delete_url ,
109- headers = HEADERS ,
109+ headers = headers ,
110110 timeout = TIMEOUT )
111111 if delete_response .status_code != 204 :
112112 print (f"ERROR: Couldn't delete cache entry with key { key } " )
@@ -136,7 +136,7 @@ def get_clang_version():
136136def get_repository_variable_or_none (name : str ) -> Optional [dict ]:
137137 _url = f"https://api.github.com/repos/{ OWNER } /{ REPO } /actions/variables/{ name } "
138138
139- response = requests .get (_url , headers = HEADERS , timeout = TIMEOUT )
139+ response = requests .get (_url , headers = headers , timeout = TIMEOUT )
140140 if response .status_code != 200 :
141141 return None
142142
@@ -156,14 +156,14 @@ def create_repository_variable(name: str, linux_sha: str, clang_version: str,
156156 })
157157 data = {"name" : name , "value" : _value }
158158
159- resp = requests .post (_url , headers = HEADERS , json = data , timeout = TIMEOUT )
159+ resp = requests .post (_url , headers = headers , json = data , timeout = TIMEOUT )
160160 print (f"create_repository_variable() response:\n { resp .content } " )
161161
162162
163163if __name__ == "__main__" :
164164 args = parse_args ()
165165
166- HEADERS = {
166+ headers = {
167167 "Accept" : "application/vnd.github+json" ,
168168 "Authorization" : f"Bearer { args .github_token } " ,
169169 "X-GitHub-Api-Version" : "2022-11-28" ,
@@ -228,7 +228,7 @@ def create_repository_variable(name: str, linux_sha: str, clang_version: str,
228228 """ )
229229 update_repository_variable (
230230 VAR_NAME ,
231- http_headers = HEADERS ,
231+ http_headers = headers ,
232232 sha = curr_sha ,
233233 clang_version = curr_clang_version ,
234234 patches_hash = curr_patches_hash ,
0 commit comments