-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (39 loc) · 1.25 KB
/
sync-dbt-schema.yaml
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
37
38
39
40
41
42
43
44
45
46
name: Sync DBT schema
on:
pull_request:
types: [labeled, opened]
branches:
- main
paths:
- 'models/**'
- '.github/workflows/sync-dbt-schema.yaml'
jobs:
sync-dbt-schema:
if: contains(github.event.pull_request.labels.*.name, 'sync-dbt-schema')
name: Sync DBT schema
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Get all changed files using a comma separator
id: changed-files
uses: tj-actions/changed-files@v35
with:
separator: ','
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-actions.txt
- name: Run script for syncing DBT schema
run: |
python .github/workflows/scripts/sync_dbt_schema.py --modified-files ${{ steps.changed-files.outputs.all_modified_files }} --graphql-url ${{ secrets.BACKEND_GRAPHQL_URL }}
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Update metadata'