-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.14 KB
/
Copy pathshellcheck.yml
File metadata and controls
43 lines (38 loc) · 1.14 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
name: ShellCheck
on:
push:
paths:
- '**.sh'
pull_request:
paths:
- '**.sh'
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get install -y shellcheck
- name: Run ShellCheck
run: |
echo "## ShellCheck Results" >> $GITHUB_STEP_SUMMARY
ERRORS=0
for f in *.sh; do
echo "### $f" >> $GITHUB_STEP_SUMMARY
if shellcheck --severity=warning \
--exclude=SC1090,SC1091,SC2034,SC2086 \
"$f" 2>&1 | tee /tmp/sc_out.txt; then
echo "✅ No issues" >> $GITHUB_STEP_SUMMARY
else
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat /tmp/sc_out.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
ERRORS=$((ERRORS + 1))
fi
done
echo "---" >> $GITHUB_STEP_SUMMARY
echo "**$ERRORS script(s) with warnings**" >> $GITHUB_STEP_SUMMARY
# Warn but don't fail the build
exit 0