From 39f0d42cfe54f9c96ecd73d14d8b2786d5046a1d Mon Sep 17 00:00:00 2001 From: "ashish.alex10@gmail.com" Date: Wed, 30 Apr 2025 23:05:14 +0100 Subject: [PATCH] fix(actions): gracefully exit when no actions to run --- cli/index.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/index.ts b/cli/index.ts index 015e084a1..dd3147ad8 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -532,11 +532,6 @@ export function runCli() { printSuccess("Unit tests completed successfully.\n"); } - if (argv[dryRunOptionName]) { - print("Dry running (no changes to the warehouse will be applied)..."); - } else { - print("Running...\n"); - } let bigqueryOptions: {} = { actionRetryLimit: argv[actionRetryLimitName] }; @@ -555,6 +550,18 @@ export function runCli() { executionGraph.actions.forEach(action => { actionsByName.set(targetAsReadableString(action.target), action); }); + + if (actionsByName.size === 0) { + print("No actions to run...\n"); + return 0; + } + + if (argv[dryRunOptionName]) { + print("Dry running (no changes to the warehouse will be applied)..."); + } else { + print("Running...\n"); + } + const alreadyPrintedActions = new Set(); const printExecutedGraph = (executedGraph: dataform.IRunResult) => {