chore: status badges #3
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
| name: lint | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| shell-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install ShellCheck and shfmt | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| curl -sSLo /usr/local/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.7.0/shfmt_v3.7.0_linux_amd64 | |
| sudo chmod +x /usr/local/bin/shfmt | |
| - name: Run ShellCheck | |
| run: | | |
| shellcheck -S warning scripts/*.sh || { | |
| echo "ShellCheck issues found"; exit 1; } | |
| - name: Check formatting with shfmt | |
| run: | | |
| shfmt -d -i 2 -ci -s scripts || { | |
| echo "shfmt found formatting differences (run: shfmt -w -i 2 -ci -s scripts)"; exit 1; } |