Fork of https://github.com/fal-ai/dbt-cloud-action with additional capabilities as the original repo and action seem inactive.
This action lets you trigger a job run on dbt Cloud, fetches the run_results.json
artifact, and git checkout
s the branch that was ran by dbt Cloud.
dbt_cloud_url
- dbt Cloud API URL (Default:https://cloud.getdbt.com
)dbt_cloud_token
- dbt Cloud API tokendbt_cloud_account_id
- dbt Cloud Account IDdbt_cloud_job_id
- dbt Cloud Job ID
We recommend passing sensitive variables as GitHub secrets. Example usage.
failure_on_error
- Boolean to make the action report a failure when dbt-cloud runs. Mark this asfalse
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 tofalse
, useful for jobs which do not generate artifacts.
Use any of the documented options for the dbt API.
cause
(Default:Triggered by a Github Action
)git_sha
git_branch
schema_override
dbt_version_override
threads_override
target_name_override
generate_docs_override
timeout_seconds_override
steps_override
: pass a YAML-parseable string. (e.g.steps_override: '["dbt seed", "dbt run"]'
)
name: Run dbt Cloud job
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: fal-ai/dbt-cloud-action@main
id: dbt_cloud_job_run
with:
dbt_cloud_token: ${{ secrets.DBT_CLOUD_API_TOKEN }}
dbt_cloud_account_id: ${{ secrets.DBT_CLOUD_ACCOUNT_ID }}
dbt_cloud_job_id: ${{ secrets.DBT_CLOUD_JOB_ID }}
failure_on_error: true
steps_override: |
- dbt build -s my_model+
- dbt docs generate
This will trigger the CI job. If a new commit is pushed to the PR, the current job gets cancelled and a new one is created.
name: Run dbt Cloud CI job
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: fal-ai/dbt-cloud-action@main
id: dbt_cloud_ci_job_run
with:
dbt_cloud_token: ${{ secrets.DBT_CLOUD_API_TOKEN }}
dbt_cloud_account_id: ${{ secrets.DBT_CLOUD_ACCOUNT_ID }}
dbt_cloud_job_id: ${{ secrets.DBT_CLOUD_JOB_ID }}
git_branch: ${{ github.head_ref }}
target_name_override: dbt_pr_${{ github.event.pull_request.number }}
cause: "CI job triggered from GH action"
failure_on_error: true