refactor: modularize dotfiles with shared libraries and new features #1
Workflow file for this run
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: Shellcheck | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - '**.sh' | |
| - '.github/workflows/shellcheck.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '**.sh' | |
| - '.github/workflows/shellcheck.yml' | |
| jobs: | |
| shellcheck: | |
| name: Shellcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install shellcheck | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| - name: Run shellcheck on all shell scripts | |
| run: | | |
| echo "Finding shell scripts..." | |
| find . -name "*.sh" -type f | head -20 | |
| echo "" | |
| echo "Running shellcheck..." | |
| find . -name "*.sh" -type f -print0 | \ | |
| xargs -0 shellcheck --severity=warning --shell=bash \ | |
| -e SC1090 \ | |
| -e SC1091 \ | |
| -e SC2034 | |
| - name: Verify bash syntax | |
| run: | | |
| echo "Checking bash syntax..." | |
| errors=0 | |
| while IFS= read -r -d '' file; do | |
| if ! bash -n "$file" 2>&1; then | |
| echo "Syntax error in: $file" | |
| errors=$((errors + 1)) | |
| fi | |
| done < <(find . -name "*.sh" -type f -print0) | |
| if [ $errors -gt 0 ]; then | |
| echo "Found $errors files with syntax errors" | |
| exit 1 | |
| fi | |
| echo "All shell scripts have valid syntax" |