From b740a4e483b06de101e03cac50bbf050628aecb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Volf?= Date: Fri, 3 Jan 2025 13:45:17 +0100 Subject: [PATCH] ci: handle no shell files in the Shellcheck check --- .github/workflows/shellcheck-check.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shellcheck-check.yaml b/.github/workflows/shellcheck-check.yaml index bdf67f6..f109fdf 100644 --- a/.github/workflows/shellcheck-check.yaml +++ b/.github/workflows/shellcheck-check.yaml @@ -24,5 +24,10 @@ jobs: with: 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