Skip to content

Commit

Permalink
Test linting scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 17, 2025
1 parent 4987ae2 commit a5c8e7c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci-oci-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,17 @@ jobs:
run: |
set -eux
sudo apt-get install -y shellcheck
EXCLUDE_CODES="SC1090,SC2034,SC2046,SC2154,SC2155"
EXCLUDE_CODES="SC1090,SC2034,SC2046,SC2154"
find install/OneClickInstall tests -type f -name "*.sh" ! -path "install/OneClickInstall/install-Docker.sh" \
| xargs shellcheck --exclude="$EXCLUDE_CODES" --severity=warning | tee shellcheck_output
awk '
/\(warning\):/ { warnings++ }
/\(error\):/ { errors++ }
END {
warnings += 0; errors += 0;
if (warnings > 0 || errors > 0) {
printf "::warning ::ShellCheck detected %d warnings and %d errors\n", warnings, errors
} else {
print "No warnings or errors detected by ShellCheck."
}
printf "::%s ::ShellCheck detected %d warnings and %d errors\n" \
$([ $warnings -gt 0 ] || [ $errors -gt 0 ] && echo "warning" || echo "info") \
"$warnings" "$errors"
}' shellcheck_output
- name: Determine affected distributions
Expand Down

0 comments on commit a5c8e7c

Please sign in to comment.