From d7941be4b0437fe4961035582e7fb31940c1f8a9 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Fri, 8 Jan 2021 20:52:57 +0000 Subject: [PATCH 01/19] Add option allow_matching_sha --- action.yml | 4 ++++ dist/index.js | 9 +++++++-- package.json | 2 +- src/index.ts | 13 ++++++++++--- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index b60e5860..3ae80ada 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: workflow_id: description: 'Optional - A single Workflow ID or a comma separated list of IDs' required: false + allow_matching_sha: + description: 'Allow matching SHA to be canceled. Useful when cancelling other workflows.' + required: false + default: false access_token: description: 'Your GitHub Access Token, defaults to: {{ github.token }}' default: '${{ github.token }}' diff --git a/dist/index.js b/dist/index.js index 14693238..f7c0275a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5859,6 +5859,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); + const allow_matching_sha = core.getInput('allow_matching_sha', { required: false }); console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids = []; const octokit = github.getOctokit(token); @@ -5885,9 +5886,13 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && run.head_sha !== headSha && run.status !== 'completed' && + console.log(data.workflow_runs.map(run => `- ${run.workflow_url}`).join("\n")); + const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && + (allow_matching_sha || run.head_sha !== headSha) && + run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); - console.log(`Found ${runningWorkflows.length} runs in progress.`); + console.log(`Found ${runningWorkflows.length} runs in to cancel.`); + console.log(runningWorkflows.map(run => `- ${run.workflow_url}`).join("\n")); for (const { id, head_sha, status } of runningWorkflows) { console.log('Cancelling another run: ', { id, head_sha, status }); const res = await octokit.actions.cancelWorkflowRun({ diff --git a/package.json b/package.json index 6fd70be8..7a6cb237 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cancel-workflow-action", - "version": "0.6.0", + "version": "0.6.1", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/src/index.ts b/src/index.ts index e7d9b8ee..abe7d689 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); + const allow_matching_sha = core.getInput('allow_matching_sha', { required: false }); console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids: string[] = []; const octokit = github.getOctokit(token); @@ -55,11 +56,17 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); + console.log(data.workflow_runs.map(run => `- ${run.workflow_url}`).join("\n")); + const runningWorkflows = data.workflow_runs.filter( - run => run.head_branch === branch && run.head_sha !== headSha && run.status !== 'completed' && - new Date(run.created_at) < new Date(current_run.created_at) + run => run.head_branch === branch && + (allow_matching_sha || run.head_sha !== headSha) && + run.status !== 'completed' && + new Date(run.created_at) < new Date(current_run.created_at) ); - console.log(`Found ${runningWorkflows.length} runs in progress.`); + console.log(`Found ${runningWorkflows.length} runs in to cancel.`); + console.log(runningWorkflows.map(run => `- ${run.workflow_url}`).join("\n")); + for (const {id, head_sha, status} of runningWorkflows) { console.log('Cancelling another run: ', {id, head_sha, status}); const res = await octokit.actions.cancelWorkflowRun({ From 84d676963411d4fea8b63182b075b8e4859f6bb0 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Fri, 8 Jan 2021 21:34:39 +0000 Subject: [PATCH 02/19] Update allow_matching_sha check --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index f7c0275a..3c503c69 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5859,7 +5859,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); - const allow_matching_sha = core.getInput('allow_matching_sha', { required: false }); + const allow_matching_sha = core.getInput('allow_matching_sha', { required: true }) === 'true'; console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids = []; const octokit = github.getOctokit(token); diff --git a/src/index.ts b/src/index.ts index abe7d689..171abd42 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); - const allow_matching_sha = core.getInput('allow_matching_sha', { required: false }); + const allow_matching_sha = core.getInput('allow_matching_sha', { required: true }) === 'true'; console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids: string[] = []; const octokit = github.getOctokit(token); From 6e1b3081f05985a93c8f13a3e4062c4ab35c059f Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Fri, 8 Jan 2021 21:42:14 +0000 Subject: [PATCH 03/19] Use html_url for logs --- dist/index.js | 4 ++-- src/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3c503c69..15695096 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5886,13 +5886,13 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.workflow_url}`).join("\n")); + console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join("\n")); const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && (allow_matching_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); console.log(`Found ${runningWorkflows.length} runs in to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.workflow_url}`).join("\n")); + console.log(runningWorkflows.map(run => `- ${run.html_url}`).join("\n")); for (const { id, head_sha, status } of runningWorkflows) { console.log('Cancelling another run: ', { id, head_sha, status }); const res = await octokit.actions.cancelWorkflowRun({ diff --git a/src/index.ts b/src/index.ts index 171abd42..0ddde501 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,7 +56,7 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.workflow_url}`).join("\n")); + console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join("\n")); const runningWorkflows = data.workflow_runs.filter( run => run.head_branch === branch && @@ -65,7 +65,7 @@ async function main() { new Date(run.created_at) < new Date(current_run.created_at) ); console.log(`Found ${runningWorkflows.length} runs in to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.workflow_url}`).join("\n")); + console.log(runningWorkflows.map(run => `- ${run.html_url}`).join("\n")); for (const {id, head_sha, status} of runningWorkflows) { console.log('Cancelling another run: ', {id, head_sha, status}); From 48830548c662d5e27869a013ea17d7ad70ed935f Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:54:52 -0500 Subject: [PATCH 04/19] Update action.yml Co-authored-by: Steven --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3ae80ada..8941658b 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ inputs: workflow_id: description: 'Optional - A single Workflow ID or a comma separated list of IDs' required: false - allow_matching_sha: + ignore_sha: description: 'Allow matching SHA to be canceled. Useful when cancelling other workflows.' required: false default: false From 053da2433007495d6e247376521bd9fc2d7caefa Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:55:18 -0500 Subject: [PATCH 05/19] Update action.yml Co-authored-by: Steven --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8941658b..f3c505bd 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ inputs: description: 'Optional - A single Workflow ID or a comma separated list of IDs' required: false ignore_sha: - description: 'Allow matching SHA to be canceled. Useful when cancelling other workflows.' + description: 'Optional - Allow canceling other workflows with the same SHA. Useful for the `pull_request.closed` event.' required: false default: false access_token: From cc420600178df9fa094b0d8fe49c39dfbdaf8253 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:55:33 -0500 Subject: [PATCH 06/19] Update dist/index.js Co-authored-by: Steven --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 15695096..6b247a1c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5859,7 +5859,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); - const allow_matching_sha = core.getInput('allow_matching_sha', { required: true }) === 'true'; + const ignore_sha = core.getInput('ignore_sha', { required: false }) === 'true'; console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids = []; const octokit = github.getOctokit(token); @@ -6068,4 +6068,4 @@ module.exports = require("zlib"); /******/ // Load entry module and return exports /******/ return __webpack_require__(144); /******/ })() -; \ No newline at end of file +; From 9ef6740807162e50889301cd91849d94ae2118c3 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:56:00 -0500 Subject: [PATCH 07/19] Update dist/index.js Co-authored-by: Steven --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 6b247a1c..52c4a641 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5888,7 +5888,7 @@ async function main() { console.log(`Found ${data.total_count} runs total.`); console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join("\n")); const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && - (allow_matching_sha || run.head_sha !== headSha) && + (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); console.log(`Found ${runningWorkflows.length} runs in to cancel.`); From 5a475927296cb912f2d2ef57c07343ed557753e6 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:56:06 -0500 Subject: [PATCH 08/19] Update dist/index.js Co-authored-by: Steven --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 52c4a641..b1b781fd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5892,7 +5892,7 @@ async function main() { run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); console.log(`Found ${runningWorkflows.length} runs in to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.html_url}`).join("\n")); + console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); for (const { id, head_sha, status } of runningWorkflows) { console.log('Cancelling another run: ', { id, head_sha, status }); const res = await octokit.actions.cancelWorkflowRun({ From 7ed945fe3c2608f15f5b5f6146c12dbf21e3f2a8 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:57:11 -0500 Subject: [PATCH 09/19] Update dist/index.js --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index b1b781fd..92a80959 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5886,7 +5886,7 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join("\n")); + console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join('\n')); const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && From 2a15f55ba4c649a4d7c3d7f5381f7ac04c5aed9a Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:57:33 -0500 Subject: [PATCH 10/19] Update dist/index.js --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 92a80959..a4cfc062 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5891,7 +5891,7 @@ async function main() { (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); - console.log(`Found ${runningWorkflows.length} runs in to cancel.`); + console.log(`Found ${runningWorkflows.length} runs to cancel.`); console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); for (const { id, head_sha, status } of runningWorkflows) { console.log('Cancelling another run: ', { id, head_sha, status }); From bae3def5013b5348d6846772bab565045639c7a4 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:59:16 -0500 Subject: [PATCH 11/19] Update package.json Co-authored-by: Steven --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a6cb237..6fd70be8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cancel-workflow-action", - "version": "0.6.1", + "version": "0.6.0", "main": "dist/index.js", "license": "MIT", "scripts": { From 6ea6d85ab2c9896dce8a6b4bb72571a21734ac3d Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:59:24 -0500 Subject: [PATCH 12/19] Update src/index.ts Co-authored-by: Steven --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 0ddde501..e27e4078 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ async function main() { console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID }); const token = core.getInput('access_token', { required: true }); const workflow_id = core.getInput('workflow_id', { required: false }); - const allow_matching_sha = core.getInput('allow_matching_sha', { required: true }) === 'true'; + const ignore_sha = core.getInput('ignore_sha', { required: false }) === 'true'; console.log(`Found token: ${token ? 'yes' : 'no'}`); const workflow_ids: string[] = []; const octokit = github.getOctokit(token); From 9dfb5c01bc6dda485caf4d0cbcbc8b2d81bf753b Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 13:59:51 -0500 Subject: [PATCH 13/19] Update src/index.ts Co-authored-by: Steven --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e27e4078..5f1db730 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ async function main() { const runningWorkflows = data.workflow_runs.filter( run => run.head_branch === branch && - (allow_matching_sha || run.head_sha !== headSha) && + (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at) ); From ffda3212e71070badcadc3b0e26740c541a2e56a Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 14:00:14 -0500 Subject: [PATCH 14/19] Update src/index.ts Co-authored-by: Steven --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5f1db730..22aaca4d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,7 +65,7 @@ async function main() { new Date(run.created_at) < new Date(current_run.created_at) ); console.log(`Found ${runningWorkflows.length} runs in to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.html_url}`).join("\n")); + console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); for (const {id, head_sha, status} of runningWorkflows) { console.log('Cancelling another run: ', {id, head_sha, status}); From fa5fa40bbe5fc702058bf46624631b6742b34f23 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 14:00:28 -0500 Subject: [PATCH 15/19] Update src/index.ts --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 22aaca4d..2e3ccc71 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ async function main() { run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at) ); - console.log(`Found ${runningWorkflows.length} runs in to cancel.`); + console.log(`Found ${runningWorkflows.length} runs to cancel.`); console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); for (const {id, head_sha, status} of runningWorkflows) { From cade94729f56824802bfca6244a72c375fa73e70 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 19:05:12 +0000 Subject: [PATCH 16/19] Update index.ts --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2e3ccc71..65dd8d38 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,7 +56,7 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join("\n")); + console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join('\n')); const runningWorkflows = data.workflow_runs.filter( run => run.head_branch === branch && From 36027193b8694eb39714c7ef5972381dbaf9fc11 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 19:05:28 +0000 Subject: [PATCH 17/19] yarn build update --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index a4cfc062..dd6ade23 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6068,4 +6068,4 @@ module.exports = require("zlib"); /******/ // Load entry module and return exports /******/ return __webpack_require__(144); /******/ })() -; +; \ No newline at end of file From 483010285ded13653717fd048f4673da2382662d Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 22:42:55 +0000 Subject: [PATCH 18/19] Revert console.log() --- dist/index.js | 4 +--- src/index.ts | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index dd6ade23..bb8a82ba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5886,13 +5886,11 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join('\n')); const runningWorkflows = data.workflow_runs.filter(run => run.head_branch === branch && (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at)); - console.log(`Found ${runningWorkflows.length} runs to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); + console.log(`Found ${runningWorkflows.length} runs in progress.`); for (const { id, head_sha, status } of runningWorkflows) { console.log('Cancelling another run: ', { id, head_sha, status }); const res = await octokit.actions.cancelWorkflowRun({ diff --git a/src/index.ts b/src/index.ts index 65dd8d38..3aeccfe6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,17 +56,13 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - console.log(data.workflow_runs.map(run => `- ${run.html_url}`).join('\n')); - const runningWorkflows = data.workflow_runs.filter( run => run.head_branch === branch && (ignore_sha || run.head_sha !== headSha) && run.status !== 'completed' && new Date(run.created_at) < new Date(current_run.created_at) ); - console.log(`Found ${runningWorkflows.length} runs to cancel.`); - console.log(runningWorkflows.map(run => `- ${run.html_url}`).join('\n')); - + console.log(`Found ${runningWorkflows.length} runs in progress.`); for (const {id, head_sha, status} of runningWorkflows) { console.log('Cancelling another run: ', {id, head_sha, status}); const res = await octokit.actions.cancelWorkflowRun({ From f80922ea361b2e9d7632f503cb01d93a6892d5f4 Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Mon, 11 Jan 2021 22:43:52 +0000 Subject: [PATCH 19/19] Little cleanup --- src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3aeccfe6..b3f5740e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,11 +56,11 @@ async function main() { branch, }); console.log(`Found ${data.total_count} runs total.`); - const runningWorkflows = data.workflow_runs.filter( - run => run.head_branch === branch && - (ignore_sha || run.head_sha !== headSha) && - run.status !== 'completed' && - new Date(run.created_at) < new Date(current_run.created_at) + const runningWorkflows = data.workflow_runs.filter(run => + run.head_branch === branch && + (ignore_sha || run.head_sha !== headSha) && + run.status !== 'completed' && + new Date(run.created_at) < new Date(current_run.created_at) ); console.log(`Found ${runningWorkflows.length} runs in progress.`); for (const {id, head_sha, status} of runningWorkflows) {