File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,16 +20,36 @@ jobs:
2020 - name : Checkout repository
2121 uses : actions/checkout@v3
2222
23+ - name : Get changed files
24+ id : changed-files
25+ uses : tj-actions/changed-files@v43
26+
27+ - name : " Show which files we check"
28+ shell : bash {0}
29+ run : |
30+ echo "# Checked files:" >> $GITHUB_STEP_SUMMARY
31+ echo "${{ steps.changed-files.outputs.all_changed_files }}" | sed "s/ /\n/g" >> $GITHUB_STEP_SUMMARY
32+
2333 - name : Environment variables
2434 run : sudo -E bash -c set
2535
2636 - name : " Shellcheck lint error report in diff format"
2737 shell : bash {0}
2838 run : |
2939
30- for file in $(find . -name "*.sh" ! -path '*/.git*/*' -exec grep -Iq . {} \; -print); do
31- if grep -qE "^#\!/.*bash" $file; then
32- shellcheck --severity=error $file || ret=$?
33- fi
34- done
40+ if [[ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]]; then
41+ FILES="${{ steps.changed-files.outputs.all_changed_files }}"
42+ for file in $FILES; do
43+ if grep -qE "^#\!/.*bash" $file; then
44+ shellcheck --severity=error $file || ret=$?
45+ fi
46+ done
47+ else
48+ FILES="$(find . -name "*.sh" ! -path '*/.git*/*' -exec grep -Iq . {} \; -print)"
49+ for file in $FILES; do
50+ if grep -qE "^#\!/.*bash" $file; then
51+ shellcheck --severity=error $file || ret=$?
52+ fi
53+ done
54+ fi
3555 exit $ret
You can’t perform that action at this time.
0 commit comments