Skip to content

Commit c9f4958

Browse files
authored
Merge pull request #82 from basak-qcom/full-shellcheck
workflows: scan all shell scripts
2 parents a81c8bc + b1781ef commit c9f4958

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/static-checks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- name: Install ShellCheck
54-
run: sudo apt update && sudo apt -y install shellcheck
54+
run: sudo apt update && sudo apt -y install shellcheck file
5555

5656
- uses: actions/checkout@v4
5757
with:
5858
fetch-depth: 0
5959

6060
- name: Run ShellCheck
61-
run: shellcheck scripts/*.sh
62-
61+
run: |
62+
# Run shellcheck against all files outside .git/ that `file` reports
63+
# as text/x-shellscript
64+
find . -path ./.git -prune -o -print0 | \
65+
xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "text/x-shellscript" && printf "%s\000" "$1"' -- | \
66+
xargs -0t shellcheck

0 commit comments

Comments
 (0)