name: Shell Script Quality Checks on: push: branches: [main] pull_request: permissions: contents: write jobs: shell-quality-checks: runs-on: macos-latest steps: - name: Checkout source code uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.22.6' - name: Install shell linting and testing tools run: brew install bats-core shfmt shellcheck - name: Auto-format shell scripts with shfmt run: ./scripts/format.sh - name: Run shellcheck linter and bats tests run: ./scripts/check.sh - name: Build Universal Binary for disk analyzer run: ./scripts/build-analyze.sh - name: Commit analyzer binary if updated if: github.event_name != 'pull_request' run: | if git diff --quiet -- bin/analyze-go; then echo "bin/analyze-go unchanged; nothing to commit." exit 0 fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add bin/analyze-go git commit -m "chore: update analyzer binary" git push origin HEAD:${GITHUB_REF#refs/heads/}