Skip to content

Commit

Permalink
GHA: add a sanity shellcheck (#2)
Browse files Browse the repository at this point in the history
Perform some sanity checks on shell scripts.
  • Loading branch information
syncom authored May 4, 2024
1 parent 1e43fb1 commit cf444ce
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Sanity checks"
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
shellcheck:
name: 'shellcheck'
strategy:
fail-fast: false
# Run on Linux
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 'Checkout repository'
uses: actions/[email protected]
- name: 'Install shellcheck on Ubuntu'
run: |
sudo apt update
sudo apt install shellcheck -y
- name: Run shellcheck
run: |
set -euxo pipefail
cd ${{ github.workspace }}/
shellcheck --version
for f in $(find . -path ./.git -prune -o -type f -print); do
if file "$f" | grep "shell script" &>/dev/null; then
shellcheck "$f"
fi
done

0 comments on commit cf444ce

Please sign in to comment.