File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -9911,6 +9911,7 @@ function parseWorkflowRun(run) {
9911
9911
runId : run . id ,
9912
9912
workflowId,
9913
9913
createdAt : run . created_at ,
9914
+ runNumber : run . run_number ,
9914
9915
} ;
9915
9916
}
9916
9917
function parseAllRuns ( response ) {
@@ -10071,7 +10072,7 @@ function detectConcurrentRuns(context) {
10071
10072
exitSuccess ( { shouldSkip : true } ) ;
10072
10073
}
10073
10074
else if ( context . concurrentSkipping === "same_content_newer" ) {
10074
- const concurrentIsOlder = concurrentRuns . find ( ( run ) => new Date ( run . createdAt ) . getTime ( ) < new Date ( context . currentRun . createdAt ) . getTime ( ) ) ;
10075
+ const concurrentIsOlder = concurrentRuns . find ( ( run ) => run . runNumber < context . currentRun . runNumber ) ;
10075
10076
if ( concurrentIsOlder ) {
10076
10077
core . info ( `Skip execution because the exact same files are concurrently checked in older ${ concurrentDuplicate . html_url } ` ) ;
10077
10078
exitSuccess ( { shouldSkip : true } ) ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ interface WorkflowRun {
33
33
runId : number ;
34
34
workflowId : number ;
35
35
createdAt : string ;
36
+ runNumber : number ;
36
37
}
37
38
38
39
type WRunTrigger = "pull_request" | "push" | "workflow_dispatch" | "schedule" ;
@@ -70,6 +71,7 @@ function parseWorkflowRun(run: ActionsGetWorkflowRunResponseData): WorkflowRun {
70
71
runId : run . id ,
71
72
workflowId,
72
73
createdAt : run . created_at ,
74
+ runNumber : run . run_number ,
73
75
}
74
76
}
75
77
@@ -235,7 +237,7 @@ function detectConcurrentRuns(context: WRunContext) {
235
237
core . info ( `Skip execution because the exact same files are concurrently checked in ${ concurrentDuplicate . html_url } ` ) ;
236
238
exitSuccess ( { shouldSkip : true } ) ;
237
239
} else if ( context . concurrentSkipping === "same_content_newer" ) {
238
- const concurrentIsOlder = concurrentRuns . find ( ( run ) => new Date ( run . createdAt ) . getTime ( ) < new Date ( context . currentRun . createdAt ) . getTime ( ) ) ;
240
+ const concurrentIsOlder = concurrentRuns . find ( ( run ) => run . runNumber < context . currentRun . runNumber ) ;
239
241
if ( concurrentIsOlder ) {
240
242
core . info ( `Skip execution because the exact same files are concurrently checked in older ${ concurrentDuplicate . html_url } ` ) ;
241
243
exitSuccess ( { shouldSkip : true } ) ;
You can’t perform that action at this time.
0 commit comments