Skip to content

Commit

Permalink
Let action work with dbt cloud jobs which don't produce artifacts (#24)
Browse files Browse the repository at this point in the history
Fixes #23

Previously this action would always fail on dbt cloud jobs which don't
produce artifacts, now the action can be configured to skip fetching
artifacts. I considered catching & silencing errors when fetching
artifacts rather than exposing another config option but decided against
it since it could lead to hard-to-debug scenarios for this github
action's primary use-case (running fal). Requiring a configuration
opt-in to cover this niche instead feels quite harmless.
  • Loading branch information
daniel-ferguson authored Jan 26, 2023
1 parent dd2a2c4 commit 1ea5071
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ We recommend passing sensitive variables as GitHub secrets. [Example usage](http

- `failure_on_error` - Boolean to make the action report a failure when dbt-cloud runs. Mark this as `false` to run fal after the dbt-cloud job.
- `interval` - The interval between polls in seconds (Default: `30`)
- `get_artifacts` - Whether run results, needed by fal, are fetched from dbt cloud. If using this action in other contexts this can be set to `false`, useful for jobs which do not generate artifacts.

### dbt Cloud Job configuration

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
failure_on_error:
description: Boolean to make the action report a failure when dbt-cloud runs. Mark this as `false` to run fal after the dbt-cloud job.
required: true
get_artifacts:
description: Whether run results, needed by fal, are fetched from dbt cloud. If using this action in other contexts this can be set to `false`, useful for jobs which do not generate artifacts.
required: false
default: true

cause:
description: Job trigger cause
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ async function executeAction() {
}
}

await getArtifacts(account_id, runId);
if (core.getBooleanInput('get_artifacts')) {
await getArtifacts(account_id, runId);
}

const outputs = {
"git_sha": res.data['git_sha'],
Expand Down

0 comments on commit 1ea5071

Please sign in to comment.