File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,16 @@ async function checkWorkflowRuns (id, page = 1) {
35
35
36
36
const runs = response . data . workflow_runs
37
37
38
+ // Either there were no runs for the period or we've reached the last page and
39
+ // there are no more results.
38
40
if ( runs . length === 0 ) return
39
41
40
42
const promises = [ ]
41
43
42
44
for ( const run of runs ) {
45
+ // Filter out first attempts to get only reruns. The idea is that if a rerun
46
+ // is successful it means any failed jobs in the previous run were flaky
47
+ // since a rerun without any change made them pass.
43
48
if ( run . run_attempt === 1 ) continue
44
49
if ( Date . parse ( run . created_at ) < Date . now ( ) - DAYS * ONE_DAY ) {
45
50
return Promise . all ( promises )
@@ -65,6 +70,7 @@ async function checkWorkflowJobs (id, page = 1) {
65
70
66
71
const { jobs } = response . data
67
72
73
+ // We've reached the last page and there are no more results.
68
74
if ( jobs . length === 0 ) return
69
75
70
76
for ( const job of jobs ) {
You can’t perform that action at this time.
0 commit comments