ci: add shellcheck

This commit is contained in:
Michael Grote 2024-01-29 12:23:41 +01:00
parent 4d3de74d23
commit dfe8586cdc
1 changed files with 9 additions and 2 deletions

View File

@ -19,10 +19,17 @@ steps:
- tag
shellcheck:
image: koalaman/shellcheck-alpine:stable@sha256:f73b035c8ebfc8a66ba54e07af5cc41e790cf41fff45317914b1ce677dd9cada
image: registry.mgrote.net/allzweckcontainer
commands:
- "find . -name *.sh -exec shellcheck {} +"
- |
find . -type f -not -path './.git/*' -not -path './collections/*' -exec file {} \; | while IFS= read -r line; do
if echo "$line" | grep -q "shell script"; then
file_path=$(echo "$line" | awk -F':' '{print $1}')
shellcheck "$file_path"
fi
done
when:
event:
exclude:
- tag
...