ci: handle no shell files in the Shellcheck check (#84)

This commit is contained in:
Matouš Volf 2025-01-03 13:29:20 +00:00 committed by Gitea
commit a3ebf712f9
Signed by: Gitea
GPG Key ID: 5CE0FF381D397F63

View File

@ -25,4 +25,10 @@ jobs:
fetch-depth: 0
- name: ShellCheck check
# https://www.shellcheck.net/wiki/Recursiveness
run: find . -type f -name "*.sh" -print0 | xargs -0 shellcheck
run: |
if find . -type f -name "*.sh" -print0 | grep -qz .; then
find . -type f -name "*.sh" -print0 | xargs -0 shellcheck
exit 0
else
echo "No shell scripts found. Skipping ShellCheck."
fi