Skip to content

fix(actions): gracefully exit when no actions to run #1965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
};
Expand All @@ -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<string>();

const printExecutedGraph = (executedGraph: dataform.IRunResult) => {
Expand Down