File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -6122,6 +6122,7 @@ async function main() {
6122
6122
workflow_ids . push ( String ( current_run . workflow_id ) ) ;
6123
6123
}
6124
6124
console . log ( `Found workflow_id: ${ JSON . stringify ( workflow_ids ) } ` ) ;
6125
+ const trigger_repo_id = ( payload . workflow_run || current_run ) . head_repository . id ;
6125
6126
await Promise . all ( workflow_ids . map ( async ( workflow_id ) => {
6126
6127
try {
6127
6128
const { data : { total_count, workflow_runs } , } = await octokit . actions . listWorkflowRuns ( {
@@ -6139,7 +6140,8 @@ async function main() {
6139
6140
. reduce ( ( a , b ) => Math . max ( a , b ) , cancelBefore . getTime ( ) ) ;
6140
6141
cancelBefore = new Date ( n ) ;
6141
6142
}
6142
- const runningWorkflows = workflow_runs . filter ( run => run . id !== current_run . id &&
6143
+ const runningWorkflows = workflow_runs . filter ( run => run . head_repository . id === trigger_repo_id &&
6144
+ run . id !== current_run . id &&
6143
6145
( ignore_sha || run . head_sha !== headSha ) &&
6144
6146
run . status !== 'completed' &&
6145
6147
new Date ( run . created_at ) < cancelBefore ) ;
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ async function main() {
55
55
workflow_ids . push ( String ( current_run . workflow_id ) ) ;
56
56
}
57
57
console . log ( `Found workflow_id: ${ JSON . stringify ( workflow_ids ) } ` ) ;
58
+ const trigger_repo_id = ( payload . workflow_run || current_run ) . head_repository . id ;
58
59
await Promise . all (
59
60
workflow_ids . map ( async workflow_id => {
60
61
try {
@@ -78,6 +79,7 @@ async function main() {
78
79
}
79
80
const runningWorkflows = workflow_runs . filter (
80
81
run =>
82
+ run . head_repository . id === trigger_repo_id &&
81
83
run . id !== current_run . id &&
82
84
( ignore_sha || run . head_sha !== headSha ) &&
83
85
run . status !== 'completed' &&
You can’t perform that action at this time.
0 commit comments