Skip to content

Commit eff175f

Browse files
committed
fix error if no SQL files were changed
1 parent 5dcb3db commit eff175f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/lint_sqlfluff.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ jobs:
2525
shell: bash
2626
run: |
2727
# Compose list of changed SQL files under mimic-iv/concepts and export to step output
28-
files="$(echo "${{ steps.get_file_changes.outputs.files_modified }} ${{ steps.get_file_changes.outputs.files_added }}" \
29-
| tr -s ' ' '\n' \
30-
| grep -E '^mimic-iv/concepts/.*[.]sql$' \
31-
| tr -s '\n' ' ')"
28+
raw="${{ steps.get_file_changes.outputs.files_modified }} ${{ steps.get_file_changes.outputs.files_added }}"
29+
# Check for mimic-iv SQL files which may have changed
30+
filtered="$(printf '%s' "$raw" | tr -s ' ' '\n' | grep -E '^mimic-iv/concepts/.*[.]sql$' || true)"
31+
# Turn this into a space separated list for the next step
32+
files="$(printf '%s' "$filtered" | tr -s '\n' ' ')"
3233
echo "lintees=${files}" >> "$GITHUB_OUTPUT"
3334
3435
- name: Lint SQL files

0 commit comments

Comments
 (0)