Skip to content

Commit

Permalink
Test lint check OCI packages
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 20, 2025
1 parent d3edc17 commit 01de0ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/ci-oci-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
- 'install/OneClickInstall/install-Debian.sh'
- 'install/OneClickInstall/install-RedHat.sh'

# push:
# branches:
# - 'feature/lint-check'
push:
branches:
- 'feature/lint-check'

schedule:
- cron: '00 20 * * 6' # At 23:00 on Saturday.
Expand Down Expand Up @@ -70,15 +70,7 @@ jobs:
sudo apt-get install -y shellcheck
find install/OneClickInstall tests -type f -name "*.sh" ! -path "install/OneClickInstall/install-Docker.sh" \
| xargs shellcheck --exclude="$(awk '!/^#|^$/ {print $1}' /tests/lint/sc_ignore | paste -sd ",")" --severity=warning | tee sc_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
}
}' sc_output
awk '/\(warning\):/ {w++} /\(error\):/ {e++} END {if (w+e) printf "::warning ::ShellCheck detected %d warnings and %d errors\n", w+0, e+0}' sc_output
- name: Determine affected distributions
id: determine-distros
Expand Down
2 changes: 1 addition & 1 deletion tests/lint/sc_ignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ SC2046 # Example: ${package_manager} -y install $([ "$DIST" != "fedora" ] && ech
SC2154 # Example: echo "${product}"

# SC2155: Declare and assign separately to avoid masking return values. Combined for simplicity.
SC2155 # Example: local AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }')
#SC2155 # Example: local AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }')

0 comments on commit 01de0ae

Please sign in to comment.