23 lines
699 B
YAML
23 lines
699 B
YAML
# Check every bash script with shellcheck (settings in .shellcheckrc)
|
|
name: shellcheck
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
shellcheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install shellcheck
|
|
run: |
|
|
SUDO=$(command -v sudo || true)
|
|
$SUDO apt-get update -q
|
|
$SUDO apt-get install -y -q shellcheck
|
|
- name: Run shellcheck
|
|
run: |
|
|
git ls-files -z | while IFS= read -r -d '' f; do
|
|
[ -L "$f" ] && continue
|
|
case "$f" in *.sh|*.conf) echo "$f"; continue ;; esac
|
|
head -n 1 "$f" | grep -q '^#!.*bash' && echo "$f"
|
|
done | xargs -d '\n' shellcheck -S warning
|