Skip to content

Commit

Permalink
upadte GHA config to assign dbt run to PR number
Browse files Browse the repository at this point in the history
  • Loading branch information
luutuankiet committed Nov 24, 2024
1 parent 61cf8dd commit 8c15625
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/slim_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ on:
push:
branches-ignore: [ "main", "master"]

env:
TARGET_SCHEMA: dev

jobs:
validate_dbt_models:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-env
with:
PROD_ENV: ${{ secrets.PROD_ENV }}


- name: Cache Python packages
uses: actions/cache@v3
Expand Down Expand Up @@ -68,8 +67,25 @@ jobs:
run: npm install -g "@lightdash/cli@${{ steps.version.outputs.value }}" || npm install -g @lightdash/cli@latest


- uses: 8BitJonny/[email protected]
id: PR

- run: echo "PR=${prNumber}" >> $GITHUB_ENV
if: steps.PR.outputs.pr_found == 'true'
env:
prNumber: ${{ steps.PR.outputs.number }}

- name: dbt build models
run: dbt build --target ci --vars "$PR_schema"
env:
PR_schema: '"schema_name": "ci_PR_$PR"'



- name: validate dbt models
run: dbt build
run: dbt build --target ci --vars "$PR_schema"
env:
PR_schema: '"schema_name": "ci_PR_$PR"'


- name: validate LD
Expand Down

0 comments on commit 8c15625

Please sign in to comment.