From 191eae7d88b271ec402f419273efd746d0329bd0 Mon Sep 17 00:00:00 2001 From: Max Powis <5753607+maxpowis@users.noreply.github.com> Date: Mon, 11 Dec 2023 21:46:01 +0100 Subject: [PATCH] Add dbt cloud API parameterization (#28) * Add dbt_cloud_url config key * Add https:// prefix to api url variable --- README.md | 1 + action.yml | 4 ++++ index.js | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28fb4ed..41fb747 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Example usage at [fal-ai/fal_bike_example](https://github.com/fal-ai/fal_bike_ex ### Credentials +- `dbt_cloud_url` - dbt Cloud [API URL](https://docs.getdbt.com/dbt-cloud/api-v2#/) (Default: `https://cloud.getdbt.com`) - `dbt_cloud_token` - dbt Cloud [API token](https://docs.getdbt.com/docs/dbt-cloud/dbt-cloud-api/service-tokens) - `dbt_cloud_account_id` - dbt Cloud Account ID - `dbt_cloud_job_id` - dbt Cloud Job ID diff --git a/action.yml b/action.yml index 8c439a4..4b7477a 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,10 @@ branding: icon: "cloud" color: "orange" inputs: + dbt_cloud_url: + description: dbt Cloud base API URL + required: false + default: https://cloud.getdbt.com dbt_cloud_token: description: dbt Cloud API token required: true diff --git a/index.js b/index.js index 200fa2c..2717333 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,7 @@ const run_status = { } const dbt_cloud_api = axios.create({ - baseURL: 'https://cloud.getdbt.com/api/v2/', + baseURL: `${core.getInput('dbt_cloud_url')}/api/v2/`, timeout: 5000, // 5 seconds headers: { 'Authorization': `Token ${core.getInput('dbt_cloud_token')}`,