wtf is happening #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |