Files
dockerfiles/shellcheck.sh
Uwe Hermann 9504b924ae
All checks were successful
Build and push / check and test (push) Successful in 6s
Build and push / build_and_push (push) Successful in 2m40s
* MOD: workflow tests
Signed-off-by: Uwe Hermann <uh@uleenucks.de>
2024-01-21 13:55:55 +01:00

25 lines
471 B
Bash
Executable File

#!/bin/bash
set -e
set -o pipefail
ERRORS=()
# find all executables and run `shellcheck`
for f in $(find . -type f -not -iwholename '*.git*' -not -name "Dockerfile" | sort -u); do
if file "$f" | grep --quiet shell; then
{
shellcheck "$f" && echo "[OK]: sucessfully linted $f"
} || {
# add to errors
ERRORS+=("$f")
}
fi
done
if [ ${#ERRORS[@]} -eq 0 ]; then
echo "No errors, hooray"
else
echo "These files failed shellcheck: ${ERRORS[*]}"
exit 1
fi