@@ -230,19 +230,17 @@ function detectConcurrentRuns(context: WRunContext) {
230
230
core . info ( `Skip execution because a newer instance of the same workflow is running in ${ newerRun . html_url } ` ) ;
231
231
exitSuccess ( { shouldSkip : true } ) ;
232
232
}
233
- } else if ( context . concurrentSkipping === "same_content" || context . concurrentSkipping === "same_content_newer" ) {
233
+ } else if ( context . concurrentSkipping === "same_content" ) {
234
234
const concurrentDuplicate = concurrentRuns . find ( ( run ) => run . treeHash === context . currentRun . treeHash ) ;
235
235
if ( concurrentDuplicate ) {
236
- if ( context . concurrentSkipping === "same_content" ) {
237
- core . info ( `Skip execution because the exact same files are concurrently checked in ${ concurrentDuplicate . html_url } ` ) ;
238
- exitSuccess ( { shouldSkip : true } ) ;
239
- } else if ( context . concurrentSkipping === "same_content_newer" ) {
240
- const concurrentIsOlder = concurrentRuns . find ( ( run ) => run . runNumber < context . currentRun . runNumber ) ;
241
- if ( concurrentIsOlder ) {
242
- core . info ( `Skip execution because the exact same files are concurrently checked in older ${ concurrentDuplicate . html_url } ` ) ;
243
- exitSuccess ( { shouldSkip : true } ) ;
244
- }
245
- }
236
+ core . info ( `Skip execution because the exact same files are concurrently checked in ${ concurrentDuplicate . html_url } ` ) ;
237
+ exitSuccess ( { shouldSkip : true } ) ;
238
+ }
239
+ } else if ( context . concurrentSkipping === "same_content_newer" ) {
240
+ const concurrentIsOlder = concurrentRuns . find ( ( run ) => ( run . treeHash === context . currentRun . treeHash ) && ( run . runNumber < context . currentRun . runNumber ) ) ;
241
+ if ( concurrentIsOlder ) {
242
+ core . info ( `Skip execution because the exact same files are concurrently checked in older ${ concurrentIsOlder . html_url } ` ) ;
243
+ exitSuccess ( { shouldSkip : true } ) ;
246
244
}
247
245
}
248
246
core . info ( `Did not find any skippable concurrent workflow-runs` ) ;
0 commit comments