name: Lint Shell on: pull_request: push: branches: - main - master jobs: shell-syntax: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Bash Syntax Check run: | set -euo pipefail mapfile -t files < <(git ls-files '*.sh') if [ "${#files[@]}" -eq 0 ]; then echo "No shell scripts found" exit 0 fi for f in "${files[@]}"; do bash -n "$f" done - name: ShellCheck run: | set -euo pipefail sudo apt-get -qq install -y shellcheck mapfile -t files < <(git ls-files '*.sh') if [ "${#files[@]}" -eq 0 ]; then echo "No shell scripts found" exit 0 fi shellcheck -x -S warning "${files[@]}"