chg: Updated Readme for SLES15SP6 compatibility, small enhancements a… #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#$ more .github/workflows/shellcheck.yml | |
name: Shellcheck Lint | |
#description: Automated checking of shell scripts using shellcheck utility | |
# The workflow is not valid. .github/workflows/shellcheck.yml (Line: 3, Col: 1): Unexpected value 'description' .github/workflows/shellcheck.yml (Line: 5, Col: 1): Unexpected value 'runs' | |
# runs: | |
# using: 'node16' | |
# main: 'start.js' | |
# branding: | |
# icon: 'arrow-up-circle' | |
# color: 'green' | |
on: | |
push: | |
paths: ### maybe wrong indention? FIXME! # Incorrect type. Expected "array". | |
# Run workflow on every push | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Shellcheck Lint | |
# This job runs on Linux | |
runs-on: ubuntu-latest | |
steps: | |
# Required to access files of this repository | |
- uses: actions/checkout@master | |
# Download Shellcheck and add it to the workflow path | |
- name: Download Shellcheck | |
run: | | |
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" | tar -xJv | |
chmod +x shellcheck-stable/shellcheck | |
# Verify that Shellcheck can be executed | |
- name: Check Shellcheck Version | |
run: | | |
shellcheck-stable/shellcheck --version | |
# Run Shellcheck on repository | |
# --- | |
# https://github.com/koalaman/shellcheck | |
# --- | |
# Excluded checks: | |
# https://www.shellcheck.net/wiki/SC1091 -- Not following: /etc/rc.status was... | |
# https://www.shellcheck.net/wiki/SC1090 -- Can't follow non-constant source. .. | |
# --- | |
- name: Run Shellcheck | |
run: | | |
rm -f ./some_scripts_have_failed_shellcheck | |
set +e | |
# here we need some customizing! | |
find ./ -type f -name "showscore*"| sort | while read -r sh; do | |
if [ "$(file --brief --mime-type "$sh")" == 'text/x-shellscript' ]; then | |
echo "shellcheck'ing $sh ..." | |
if ! shellcheck-stable/shellcheck --color=always --severity=warning "$sh"; then | |
touch some_scripts_have_failed_shellcheck | |
fi | |
fi | |
done | |
if [ -f ./some_scripts_have_failed_shellcheck ]; then | |
echo "[!] Shellcheck failed for one or more shellscript(s)" | |
exit 1 | |
fi |