-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (27 loc) · 1.11 KB
/
dbt-cloud-actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# see details in gist readme https://gist.github.com/jeremyyeo/429067b3c64fd5854bdfb717b4f5f303
# This is to trigger GitHub action, we need to set up the Secrets in GitHub Secrets
# see macros/data_ops/dml/drop_pr_schema.sql macro
name: Run dbt Cloud jobs
on:
pull_request:
types: [opened, synchronize, closed]
jobs:
drop_pr_schema:
# Only when PR is closed/merged.
if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fal-ai/dbt-cloud-action@main
id: drop_ci_schema
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 }}
interval: 5
failure_on_error: false
cause: "github_actions_pull_request"
git_branch: main # production branch.
schema_override: "dbt_cloud_pr_${{ secrets.DBT_CLOUD_JOB_ID }}_${{ github.event.number }}"
steps_override: |
dbt run-operation drop_pr_schema