C00ldudeNoonan / simple-dbt-runner

45 stars 6 forks source link

Stage PRs in their own schemas #11

Closed matsonj closed 1 year ago

matsonj commented 1 year ago

This is pretty clever from datafold’s implementation ->

On PR:

- name: Find Current Pull Request
  uses: jwalton/gh-find-current-pr@v1.3.0
  id: findPR
…
SNOWFLAKE_SCHEMA: "${{ format('{0}_{1}', 'PR_NUM', steps.findPr.outputs.pr) }}"

Then on PR closed:

pull_request:
   types:
     - closed

[...]

     - name: drop PR schemas

       run: dbt run-operation drop_pr_staging_schemas --args
       "{'PR_number'":" '${PR_NUM}' }" --profiles-dir ./
matsonj commented 1 year ago

The dbt run operation is related to #10, although we need to tweak slightly so that it can take these params.

matsonj commented 1 year ago

closed - i'm not going to add the drop, its better to build a clean up run op.