@@ -143,27 +143,29 @@ def set_output(name, value):
143143
144144def get_commit_depth_and_check_suite (query_commits ):
145145 while True :
146- commits = query_commits .fetch ()["data" ]["repository" ]["pullRequest" ]["commits" ]
147-
148- if commits ["totalCount" ] > 0 :
149- nodes = commits ["nodes" ]
150- nodes .reverse ()
151- if nodes [0 ]["commit" ]["oid" ] == os .environ ["EXCLUDE_COMMIT" ]:
152- nodes .pop (0 )
153- for index , commit in enumerate (nodes ):
154- commit = commit ["commit" ]
155- commit_sha = commit ["oid" ]
156- check_suites = commit ["checkSuites" ]
157- if check_suites ["totalCount" ] > 0 :
158- for check_suite in check_suites ["nodes" ]:
159- if check_suite ["workflowRun" ]["workflow" ]["name" ] == "Build CI" :
160- return [
161- {"sha" : commit_sha , "depth" : index + 1 },
162- check_suite ["id" ] if check_suite ["conclusion" ] != "SUCCESS" else None ,
163- ]
164- else :
165- if not query_commits .paginate (commits ["pageInfo" ], "beforeCommit" ):
166- break
146+ commits = query_commits .fetch ()["data" ]["repository" ]["pullRequest" ]["commits" ]
147+
148+ if commits ["totalCount" ] > 0 :
149+ nodes = commits ["nodes" ]
150+ nodes .reverse ()
151+ if nodes [0 ]["commit" ]["oid" ] == os .environ ["EXCLUDE_COMMIT" ]:
152+ nodes .pop (0 )
153+ for index , commit in enumerate (nodes ):
154+ commit = commit ["commit" ]
155+ commit_sha = commit ["oid" ]
156+ check_suites = commit ["checkSuites" ]
157+ if check_suites ["totalCount" ] > 0 :
158+ for check_suite in check_suites ["nodes" ]:
159+ if check_suite ["workflowRun" ]["workflow" ]["name" ] == "Build CI" :
160+ return [
161+ {"sha" : commit_sha , "depth" : index + 1 },
162+ check_suite ["id" ]
163+ if check_suite ["conclusion" ] != "SUCCESS"
164+ else None ,
165+ ]
166+ else :
167+ if not query_commits .paginate (commits ["pageInfo" ], "beforeCommit" ):
168+ break
167169
168170 return [None , None ]
169171
@@ -197,7 +199,9 @@ def get_bad_check_runs(query_check_runs):
197199
198200 append_runs_to_list (check_runs [run_type ], bad_runs_by_matrix )
199201
200- if query_check_runs .paginate (check_runs [run_type ]["pageInfo" ], "after" + run_type_camel ):
202+ if query_check_runs .paginate (
203+ check_runs [run_type ]["pageInfo" ], "after" + run_type_camel
204+ ):
201205 query_check_runs .variables ["include" + run_type_camel ] = True
202206 more_pages = True
203207
0 commit comments