From 1e53ebd5af4da656813950dbe31820e5b7a41451 Mon Sep 17 00:00:00 2001 From: Dharmesh Date: Sat, 7 Oct 2023 11:31:32 +0530 Subject: [PATCH] Fixed Action Condition when Goto used (#16) - Updated Action to start with 1 - Updated Batch to start with 1 - Updated tag ci-cd to run only affected --- .github/workflows/tags.yml | 2 +- apps/acf-extension/src/content_scripts/actions.ts | 2 +- apps/acf-extension/src/content_scripts/batch.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml index a26b18ec..660e126c 100644 --- a/.github/workflows/tags.yml +++ b/.github/workflows/tags.yml @@ -89,7 +89,7 @@ jobs: PUBLIC_URL=${{needs.EnvSetup.outputs.PUBLIC_URL}} RELEASE_VERSION=${{needs.EnvSetup.outputs.RELEASE_VERSION}} parallel-commands-on-agents: | - npx nx run-many --target=build --parallel=3 --exclude='tag:puppeteer' + npx nx affected --target=build --parallel=3 --exclude='tag:puppeteer' final-commands: | TARGET_FILE="./dist/apps/acf-extension/manifest.json" # Use an if-else statement to check if the file exists. diff --git a/apps/acf-extension/src/content_scripts/actions.ts b/apps/acf-extension/src/content_scripts/actions.ts index e3368258..5ecd1045 100644 --- a/apps/acf-extension/src/content_scripts/actions.ts +++ b/apps/acf-extension/src/content_scripts/actions.ts @@ -19,7 +19,7 @@ const Actions = (() => { }; const checkStatement = async (actions: Array, action: Action) => { - const actionStatus = actions.map((action) => action.status).filter((status): status is string => !!status); + const actionStatus = actions.map((action) => action.status ?? ACTION_STATUS.SKIPPED); const result = await Statement.check(actionStatus, action.statement); return result; }; diff --git a/apps/acf-extension/src/content_scripts/batch.ts b/apps/acf-extension/src/content_scripts/batch.ts index 8c58549f..a8d306f5 100644 --- a/apps/acf-extension/src/content_scripts/batch.ts +++ b/apps/acf-extension/src/content_scripts/batch.ts @@ -22,7 +22,7 @@ const BatchProcessor = (() => { if (batch.repeat) { if (batch.repeat > 0) { for (let i = 0; i < batch.repeat; i += 1) { - console.group(`${LOGGER_LETTER} #${i + 1}`); + console.group(`${LOGGER_LETTER} #${i + 2}`); if (batch?.repeatInterval) { await wait(batch?.repeatInterval, `${LOGGER_LETTER} Repeat`, batch.repeat, ''); } @@ -55,7 +55,7 @@ const BatchProcessor = (() => { const start = async (actions: Array, batch?: Batch) => { try { - console.group(`${LOGGER_LETTER} #0`); + console.group(`${LOGGER_LETTER} #1`); await Actions.start(actions, 0); console.groupEnd(); if (batch) {