From 87511d2c7105bdb0b1e33262b3aef7ae88aedaed Mon Sep 17 00:00:00 2001 From: Christian Schmidbauer Date: Thu, 11 Nov 2021 19:15:57 +0100 Subject: [PATCH] Exit successfully if no files have been found --- script.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/script.sh b/script.sh index f7733c7..fb0277f 100755 --- a/script.sh +++ b/script.sh @@ -15,6 +15,12 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" FILES=$(find "${INPUT_PATH:-'.'}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN:-'*.sh'}") +# Exit early if no files have been found +if [ -z "${FILES}" ]; then + echo "No matching files found to check." + exit 0 +fi + echo '::group:: Running shellcheck ...' if [ "${INPUT_REPORTER}" = 'github-pr-review' ]; then # erroformat: https://git.io/JeGMU