Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
laysabit committed Mar 27, 2024
1 parent 6a12780 commit fade84f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/diff-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,47 +37,6 @@ jobs:
with:
project_id: crypto-stellar
credentials_json: "${{ secrets.CREDS_PROD_HUBBLE }}"

- name: Get changed files
id: get_file_changes
uses: trilom/[email protected]
with:
output: " "

- name: Get new and changed .sql files in /models to lint
id: get_files_to_lint
shell: bash -l {0}
run: |
# Set the command in the $() brackets as an output to use in later steps
echo "::set-output name=lintees::$(
# Issue where grep regular expressions don't work as expected on the
# Github Actions shell, check dbt/models/ folder
echo \
$(echo ${{ steps.get_file_changes.outputs.files_modified }} |
tr -s ' ' '\n' |
grep -E '^models.*[.]sql$' |
tr -s '\n' ' ') \
$(echo ${{ steps.get_file_changes.outputs.files_added }} |
tr -s ' ' '\n' |
grep -E '^models.*[.]sql$' |
tr -s '\n' ' ')
)"
- name: Lint dbt models
id: sqlfluff_json
if: steps.get_files_to_lint.outputs.lintees != ''
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
dbt deps
sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
sed -i '/^\[/!d' annotations.json # see https://github.com/sqlfluff/sqlfluff/issues/2244
- name: Annotate
uses: yuzutech/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
title: "SQLFluff Lint"
input: "./annotations.json"

- name: Checkout source branch and diff quality
run: |
Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_offers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with

, offers as (
select
, seller_id
seller_id
, offer_id
, selling_asset_type
, selling_asset_code
Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_trust_lines.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with

, trust_lines as (
select
, ledger_key
ledger_key
, account_id
, asset_type
, asset_issuer
Expand Down

0 comments on commit fade84f

Please sign in to comment.