mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
28 lines
605 B
YAML
28 lines
605 B
YAML
name: Shell Linter
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint-shell:
|
|
name: 🧹 Lint shell
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Run ShellCheck (container)
|
|
run: |
|
|
mapfile -d '' shell_files < <(find . -type f -name '*.sh' -print0)
|
|
if [ "${#shell_files[@]}" -eq 0 ]; then
|
|
echo "No shell scripts found."
|
|
exit 0
|
|
fi
|
|
|
|
docker run --rm \
|
|
-v "$PWD:/mnt" \
|
|
-w /mnt \
|
|
koalaman/shellcheck:latest \
|
|
-x "${shell_files[@]}"
|