Skip to content

[dados] br_rf_arrecadacao #1106

[dados] br_rf_arrecadacao

[dados] br_rf_arrecadacao #1106

---
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@v4
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: Set up poetry
run: pipx install poetry
- name: Set up python
uses: actions/setup-python@v4
with:
cache: poetry
python-version: '3.9'
- name: Install requirements
run: poetry install --only=dev
- name: Run script for syncing DBT schema
run: |
poetry 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