Skip to content

Commit de61035

Browse files
committed
Run shellcheck in CI
1 parent baef6fe commit de61035

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.github/workflows/actionlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
# We want space splitting
2323
# shellcheck disable=SC2086
24-
for file in $(git ls-files .github/workflows/*)
24+
for file in $(git ls-files .github/workflows/*.yml)
2525
do
2626
echo "Checking $file"
2727
${{ steps.get_actionlint.outputs.executable }} -color $file || exit 1

.github/workflows/shellcheck-exceptions.txt

Whitespace-only changes.

.github/workflows/shellcheck.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: shellcheck
2+
# This pipeline runs shellcheck on all files with extension .sh,
3+
# except the ones listed in .github/workflows/shellcheck-exceptions.txt.
4+
5+
on:
6+
push:
7+
merge_group:
8+
pull_request:
9+
10+
jobs:
11+
shellcheck:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- name: Shellcheck
17+
run: |
18+
for file in $(git ls-files "*.sh")
19+
do
20+
if grep -q "$file" ".github/workflows/shellcheck-exceptions.txt"
21+
then
22+
echo "⚠️ $file is ignored from shellcheck's verifications. Please consider fixing it."
23+
else
24+
echo "shellcheck \"$file\""
25+
shellcheck "$file"
26+
fi
27+
done

0 commit comments

Comments
 (0)