Skip to content

Commit 847f82c

Browse files
authored
Merge pull request #1140 from Quick-Box/fix/clang-tidy-empty-files
Fix clang-tidy linter to handle empty file arrays correctly
2 parents 0849e87 + be656c6 commit 847f82c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/actions/run-linter/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ runs:
4949
fi
5050
echo "Changed files:"
5151
printf '%s\n' "${CHANGED_FILES[@]}"
52+
# Filter out any empty strings that may have been added to the array
53+
readarray -t CHANGED_FILES < <(printf '%s\n' "${CHANGED_FILES[@]}" | grep -v '^$')
54+
if [[ "${#CHANGED_FILES[@]}" -eq 0 ]]; then
55+
echo "No changed cpp files after filtering."
56+
exit 0
57+
fi
5258
printf '%s\n' "${CHANGED_FILES[@]}" | parallel --verbose --jobs "$(nproc)" --plus _=[{#}/{##}] ${{ inputs.lint_program_with_args }} {}

0 commit comments

Comments
 (0)