diff --git a/action.yml b/action.yml index 72d82dc..8c439a4 100644 --- a/action.yml +++ b/action.yml @@ -69,6 +69,12 @@ inputs: required: false # type: array of strings + wait_for_job: + description: Boolean for whether action should wait until dbt job finishes + required: false + default: true + + outputs: git_sha: description: "Repository SHA in which dbt Cloud Job ran" diff --git a/index.js b/index.js index 36988b5..200fa2c 100644 --- a/index.js +++ b/index.js @@ -143,8 +143,13 @@ async function executeAction() { let status = run_status[res.data.status]; core.info(`Run: ${res.data.id} - ${status}`); - if (res.data.is_complete) { - core.info(`job finished with '${status}'`); + if (core.getBooleanInput('wait_for_job')) { + if (res.data.is_complete) { + core.info(`job finished with '${status}'`); + break; + } + } else { + core.info("Not waiting for job to finish. Relevant run logs will be omitted.") break; } }