1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-05 01:34:42 +00:00
Files
Mole/.github/workflows/shell-quality-checks.yml
2025-11-18 14:16:22 +08:00

49 lines
1.3 KiB
YAML

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.24.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/}