-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (47 loc) · 1.42 KB
/
shellcheck.yml
File metadata and controls
53 lines (47 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Shellcheck
on:
pull_request:
paths:
- "scripts/*.sh"
- "scripts/**/*.sh"
- "programs/**/*.sh"
- "benchpark-bridge/scripts/*.sh"
- "benchpark-bridge/scripts/**/*.sh"
- ".github/workflows/shellcheck.yml"
push:
branches:
- "**"
paths:
- "scripts/*.sh"
- "scripts/**/*.sh"
- "programs/**/*.sh"
- "benchpark-bridge/scripts/*.sh"
- "benchpark-bridge/scripts/**/*.sh"
- ".github/workflows/shellcheck.yml"
workflow_dispatch:
jobs:
shellcheck:
name: shellcheck -S error
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install shellcheck-py
run: python -m pip install --quiet shellcheck-py
- name: Run shellcheck on shell entrypoints at error level
shell: bash
run: |
set -euo pipefail
mapfile -t files < <(find scripts/ programs/ benchpark-bridge/scripts/ -name "*.sh" 2>/dev/null | sort)
if [ "${#files[@]}" -eq 0 ]; then
echo "No shell files found; nothing to check."
exit 0
fi
echo "Checking ${#files[@]} shell files at -S error level"
shellcheck -S error -f gcc "${files[@]}"
echo "shellcheck error-level: 0"