Create empty results even when no files require checking

This commit is contained in:
Eric Nemchik 2023-02-16 09:39:29 -06:00 committed by GitHub
parent f72f5fcf8f
commit 64fefb9e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,7 @@ SHELLCKECK_IMAGE="koalaman/shellcheck:stable"
TEST_AREA=()
# clear preexising checkstyle files
if [[ -f "${WORKSPACE}"/shellcheck-result.xml ]]; then
rm "${WORKSPACE}"/shellcheck-result.xml
fi
echo "<?xml version='1.0' encoding='UTF-8'?><checkstyle version='4.3'></checkstyle>" >"${WORKSPACE}"/shellcheck-result.xml
if [[ -d "${WORKSPACE}"/init ]]; then
MOUNT_OPTIONS+=("-v" "${WORKSPACE}/init:/init")
@ -80,9 +78,5 @@ find "${ALL_SHELL_FILES[@]}" -exec \
"${SHELLCHECK_OPTIONS[@]}" {} + \
>"${WORKSPACE}"/shellcheck-result.xml
if [[ ! -f ${WORKSPACE}/shellcheck-result.xml ]]; then
echo "<?xml version='1.0' encoding='UTF-8'?><checkstyle version='4.3'></checkstyle>" >"${WORKSPACE}"/shellcheck-result.xml
fi
# exit gracefully
exit 0