From 33affc29c7a4ff9ec095f34854d119941cb9d95b Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 12 Jun 2024 03:48:34 +0800 Subject: [PATCH] fix(api): skipping dispatching new checks for in_progress checks --- dist/index.js | 8 +++++++- src/api.ts | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b90b09f..a244abe 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29143,9 +29143,15 @@ class Api { return (new Date(b.created_at).getTime() - new Date(a.created_at).getTime()); }); const run = runs[0]; + // There is a process running the check, skip + // dispatching new ones + if (run.status !== 'completed') { + core.info(`The check is running in progress: ${run.html_url}`); + process.exit(0); + } // Here we re-trigger a new workflow if the previous one // is completed and failure. - if (run.status === 'completed' && run.conclusion === 'failure') { + if (run.conclusion === 'failure') { return undefined; } return run; diff --git a/src/api.ts b/src/api.ts index 9cf5687..f18a7d5 100644 --- a/src/api.ts +++ b/src/api.ts @@ -276,9 +276,16 @@ export default class Api { const run = runs[0]; + // There is a process running the check, skip + // dispatching new ones + if (run.status !== 'completed') { + core.info(`The check is running in progress: ${run.html_url}`); + process.exit(0); + } + // Here we re-trigger a new workflow if the previous one // is completed and failure. - if (run.status === 'completed' && run.conclusion === 'failure') { + if (run.conclusion === 'failure') { return undefined; }