Skip to content

Commit

Permalink
Add option to not wait for dbt job to finish (#25)
Browse files Browse the repository at this point in the history
* Add option to not wait for dbt job to finish

* Add description for new input
  • Loading branch information
skwon615 authored Feb 17, 2023
1 parent 1ea5071 commit 08fd358
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 08fd358

Please sign in to comment.