File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ import json
2
+ import sys
3
+ import os
4
+
5
+ print ("Checking required checks" )
6
+ print (os .environ ['NEEDS' ])
7
+
8
+ # Get job names and results from GitHub context
9
+ jobs = json .loads (os .environ ['NEEDS' ])
10
+ job_names = sorted (jobs .keys ())
11
+ for job_name in job_names :
12
+ result = jobs [job_name ]['result' ]
13
+ print (f"- { job_name } : { result } " )
14
+ print ()
15
+
16
+ failed = False
17
+ for job_name in job_names :
18
+ result = jobs [job_name ]['result' ]
19
+
20
+ # Skip test-go-pg failures on windows
21
+ if job_name == "test-go-pg" :
22
+ runner_os = jobs [job_name ]['outputs' ].get ('runner_os' )
23
+ if "windows" in runner_os and result == "failure" :
24
+ continue
25
+
26
+ if result in ["failure" , "cancelled" ]:
27
+ failed = True
28
+ break
29
+
30
+ if failed :
31
+ print ("One of the required checks has failed or has been cancelled" )
32
+ sys .exit (1 )
33
+
34
+ print ("Required checks have passed" )
You can’t perform that action at this time.
0 commit comments