Update README.md #72
This file contains 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
name: Bash Lint | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install ShellCheck | |
run: | | |
echo "Installing ShellCheck..." | |
sudo apt-get update | |
sudo apt-get install -y shellcheck | |
which shellcheck || (echo "ShellCheck installation failed" && exit 1) | |
- name: Lint Bash scripts | |
run: | | |
echo "Running ShellCheck..." | |
find . -name "*.sh" -print0 | xargs -0 shellcheck -f gcc | tee shellcheck.log | |
if grep -q "error:" shellcheck.log; then | |
echo "Linting errors found!" | |
exit 1 | |
else | |
echo "No linting errors found." | |
fi |