Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech committed Jun 29, 2024
1 parent 95b24b6 commit f823929
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/bashtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,34 @@ on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, ubuntu-18.04]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Cache ShellCheck
id: cache-shellcheck
uses: actions/cache@v2
with:
path: /usr/local/bin/shellcheck
key: ${{ runner.os }}-shellcheck
restore-keys: |
${{ runner.os }}-shellcheck
- name: Install ShellCheck
if: steps.cache-shellcheck.outputs.cache-hit != 'true'
run: sudo apt-get install -y shellcheck

- 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

0 comments on commit f823929

Please sign in to comment.