generated from dpguthrie/snowflake-dbt-demo-project
-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (30 loc) · 879 Bytes
/
pre_commit.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
29
30
31
32
33
34
35
36
name: pre-commit-dbt
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
pre_commit_dbt:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9.x"
- id: file_changes
uses: trilom/[email protected]
with:
output: ' '
- name: Install pre-commit
run: python -m pip install "dbt-snowflake<1.7.0" pre-commit
- name: Run pre-commit model checks
env:
SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }}
SF_USER: ${{ secrets.SF_USER }}
SF_PASSWORD: ${{ secrets.SF_PASSWORD }}
run: |
mkdir ~/.dbt/
./.scripts/create_profile.py > ~/.dbt/profiles.yml
pre-commit run --files ${{ steps.file_changes.outputs.files}}