Skip to content

Commit 6363254

Browse files
authored
Merge pull request qualcomm-linux#118 from smuppand/shell-lint-workflow
CI: Improve ShellCheck workflow to skip deleted files in PRs
2 parents c0ddc36 + 732c37c commit 6363254

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/shellcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
run: |
2626
echo "Checking only changed shell files in PR..."
2727
git fetch origin ${{ github.base_ref }}
28-
FILES=$(git diff --name-only origin/${{ github.base_ref }} -- '*.sh' | xargs -r -n1 echo | xargs -r realpath --no-symlinks --canonicalize-missing 2>/dev/null || true)
28+
FILES=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }} -- '*.sh')
2929
if [ -n "$FILES" ]; then
30-
echo "$FILES" | tr ' ' '\n' | xargs -r shellcheck -S warning -e SC1091,SC2230,SC3043
30+
echo "$FILES" | tr '\n' '\0' | xargs -0 -r shellcheck -S warning -e SC1091,SC2230,SC3043
3131
else
3232
echo "No shell files to lint."
3333
fi

0 commit comments

Comments
 (0)