-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github): do not use outdated output syntax anymore
- Loading branch information
Showing
1 changed file
with
8 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,36 +16,21 @@ jobs: | |
- name: install sqlfluff | ||
run: "pip install sqlfluff" | ||
- name: Get changed files | ||
id: get_file_changes | ||
uses: trilom/[email protected] | ||
id: changed-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
output: " " | ||
|
||
files: | | ||
src/queries/**/*.sql | ||
files_ignore: | | ||
**/common*.sql | ||
- name: Get changed .sql files in /src/queries 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 '^src/queries.*[.]sql$' | | ||
# ignore files containing 'common' in the file name | ||
grep -v 'common' | | ||
tr -s '\n' ' ') \ | ||
$(echo ${{ steps.get_file_changes.outputs.files_added }} | | ||
tr -s ' ' '\n' | | ||
grep -E '^src/queries.*[.]sql$' | | ||
tr -s '\n' ' ') | ||
)" | ||
LINTEES="${{ steps.changed-files.outputs.all_changed_files }}" | ||
echo "lintees=${LINTEES}" >> $GITHUB_OUTPUT | ||
- name: Lint dbt models | ||
id: sqlfluff_json | ||
if: steps.get_files_to_lint.outputs.lintees != '' | ||
shell: bash -l {0} | ||
run: sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json | ||
- name: Annotate | ||
uses: yuzutech/[email protected] | ||
|