Skip to content

Commit

Permalink
fix(workflow): simplify base_trades file detection
Browse files Browse the repository at this point in the history
- Remove unnecessary negative lookahead
- Only match base_trades files in platforms directory
  • Loading branch information
Hosuke committed Jan 7, 2025
1 parent f284879 commit 3e1b6c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dbt_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
if: inputs.project == 'dex'
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch origin ${{ github.base_ref }}
CHANGES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -E "dbt_subprojects/${{ inputs.project }}/models/.*/platforms/(?!dex_).*_base_trades\.sql$" || true)
git fetch origin main
CHANGES=$(git diff --name-only origin/main..HEAD | grep -E "dbt_subprojects/${{ inputs.project }}/models/.*/platforms/.*_base_trades\.sql$" || true)
else
CHANGES=$(git diff --name-only HEAD~1 | grep -E "dbt_subprojects/${{ inputs.project }}/models/.*/platforms/(?!dex_).*_base_trades\.sql$" || true)
CHANGES=$(git diff --name-only HEAD~1 | grep -E "dbt_subprojects/${{ inputs.project }}/models/.*/platforms/.*_base_trades\.sql$" || true)
fi
if [ ! -z "$CHANGES" ]; then
Expand Down

0 comments on commit 3e1b6c1

Please sign in to comment.