Files
o-az c32ac2a0f0 feat(ci): lint shell scripts (#12797)
* feat(ci): lint shell scripts

* fixes

---------

Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
2025-12-16 12:57:22 +00:00

25 lines
622 B
Bash
Executable File

#!/usr/bin/env bash
# runs shellcheck and prints GitHub Actions annotations for each warning and error
# https://github.com/koalaman/shellcheck
IGNORE_DIRS=(
"./.git/*"
"./target/*"
)
ignore_args=()
for dir in "${IGNORE_DIRS[@]}"; do
ignore_args+=(-not -path "$dir")
done
find . -name "*.sh" "${ignore_args[@]}" -exec shellcheck -f gcc {} + | \
while IFS=: read -r file line col severity msg; do
level="warning"
[[ "$severity" == *error* ]] && level="error"
file="${file#./}"
echo "::${level} file=${file},line=${line},col=${col}::${file}:${line}:${col}:${msg}"
done
exit "${PIPESTATUS[0]}"