fix(ci): keep packaging files and shebang noise out of the shell scan
security / secrets (push) Successful in 11s
security / shell (push) Successful in 5s
security / dependencies (push) Successful in 13s
security / sast (push) Successful in 2m9s

This commit is contained in:
BlackAngelTV committed 2026-12-06 18:47:39 +01:00
1 parent efb6eeeced
commit 4afe0e0c97
1 file changed
+10 -4
+10 -4
View File
@@ -75,26 +75,32 @@ jobs:
- name: Collect the shell scripts - name: Collect the shell scripts
run: | run: |
set -euo pipefail set -euo pipefail
git ls-files -z '*.sh' '*.bash' 'PKGBUILD' > "$RUNNER_TEMP/scripts" # PKGBUILD files are bash without a shebang, so shellcheck would report
# SC2148 on every one of them: makepkg sources them, the gate does not.
git ls-files -z '*.sh' '*.bash' > "$RUNNER_TEMP/scripts"
printf '%s shell files to check\n' "$(tr -cd '\0' < "$RUNNER_TEMP/scripts" | wc -c)" printf '%s shell files to check\n' "$(tr -cd '\0' < "$RUNNER_TEMP/scripts" | wc -c)"
# SC2086/SC2046 and friends are the shapes an injection takes in shell. # SC2086/SC2046 and friends are the shapes an injection takes in shell.
# They stay advisory for now: existing scripts would turn the gate red on # They stay advisory for now: existing scripts would turn the gate red on
# their first run, so warnings are reported and errors block. # their first run, so warnings are reported and errors block. SC2148 (no
# shebang) and SC2068 (array quoting, inherited from vendored shell
# integrations) are not signals this gate can act on.
- name: Shellcheck warnings (advisory) - name: Shellcheck warnings (advisory)
continue-on-error: true continue-on-error: true
run: | run: |
set -o pipefail set -o pipefail
[ -s "$RUNNER_TEMP/scripts" ] || { echo "No shell scripts in this repository."; exit 0; } [ -s "$RUNNER_TEMP/scripts" ] || { echo "No shell scripts in this repository."; exit 0; }
xargs -0 -a "$RUNNER_TEMP/scripts" -r \ xargs -0 -a "$RUNNER_TEMP/scripts" -r \
"$RUNNER_TEMP/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" -x --format=gcc --severity=warning "$RUNNER_TEMP/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" -x --format=gcc --severity=warning \
--exclude=SC2148,SC2068
- name: Shellcheck errors - name: Shellcheck errors
run: | run: |
set -euo pipefail set -euo pipefail
[ -s "$RUNNER_TEMP/scripts" ] || { echo "No shell scripts in this repository."; exit 0; } [ -s "$RUNNER_TEMP/scripts" ] || { echo "No shell scripts in this repository."; exit 0; }
xargs -0 -a "$RUNNER_TEMP/scripts" -r \ xargs -0 -a "$RUNNER_TEMP/scripts" -r \
"$RUNNER_TEMP/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" -x --severity=error "$RUNNER_TEMP/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" -x --severity=error \
--exclude=SC2148,SC2068
sast: sast:
name: sast name: sast