ci: add shellcheck lint workflow; fix 5 violations
Lint / Shell (shellcheck) (push) Failing after 11s
Lint / Shell (shellcheck) (push) Failing after 11s
Adds shellcheck disable comments for intentional word-splitting on \$COMMON_PKGS package list (SC2086). Adds -r flag to read (SC2162). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["**"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["**"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
shell-lint:
|
||||||
|
name: Shell (shellcheck)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install shellcheck
|
||||||
|
run: apt-get update -qq && apt-get install -y -qq shellcheck
|
||||||
|
|
||||||
|
- name: Run shellcheck
|
||||||
|
run: find . -name "*.sh" -exec shellcheck {} +
|
||||||
+4
-1
@@ -52,12 +52,15 @@ COMMON_PKGS="python3-pip smartmontools python3-psutil python3-requests lm-sensor
|
|||||||
|
|
||||||
if [[ "$PLATFORM" == "pve" ]]; then
|
if [[ "$PLATFORM" == "pve" ]]; then
|
||||||
echo "Installing PVE-specific packages..."
|
echo "Installing PVE-specific packages..."
|
||||||
|
# shellcheck disable=SC2086 # intentional word splitting for package list
|
||||||
apt-get install -y $COMMON_PKGS iperf3 fio nvme-cli
|
apt-get install -y $COMMON_PKGS iperf3 fio nvme-cli
|
||||||
elif [[ "$PLATFORM" == "pbs" ]]; then
|
elif [[ "$PLATFORM" == "pbs" ]]; then
|
||||||
echo "Installing PBS-specific packages..."
|
echo "Installing PBS-specific packages..."
|
||||||
|
# shellcheck disable=SC2086 # intentional word splitting for package list
|
||||||
apt-get install -y $COMMON_PKGS zfsutils-linux nvme-cli
|
apt-get install -y $COMMON_PKGS zfsutils-linux nvme-cli
|
||||||
else
|
else
|
||||||
echo "Installing common packages..."
|
echo "Installing common packages..."
|
||||||
|
# shellcheck disable=SC2086 # intentional word splitting for package list
|
||||||
apt-get install -y $COMMON_PKGS nvme-cli
|
apt-get install -y $COMMON_PKGS nvme-cli
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -320,7 +323,7 @@ else
|
|||||||
echo "You can enter it now or configure it later by editing:"
|
echo "You can enter it now or configure it later by editing:"
|
||||||
echo " /etc/hwmonDaemon/.env"
|
echo " /etc/hwmonDaemon/.env"
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Enter API key (or press Enter to skip): " API_KEY
|
read -rp "Enter API key (or press Enter to skip): " API_KEY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine platform-specific defaults
|
# Determine platform-specific defaults
|
||||||
|
|||||||
Reference in New Issue
Block a user