Skip to content

add script to list changed files and do a branch diff #7

add script to list changed files and do a branch diff

add script to list changed files and do a branch diff #7

Workflow file for this run

---
name: Sh Lint
on:
push:
paths:
- "**.sh"
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
shell-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: uv sync --locked
- name: Run shfmt
run: |
globalStatus=0
while IFS= read -r -d '' f; do
if ! uv run shfmt --diff --indent 4 -- "$f"; then
echo "[ERROR] shfmt failed for $f"
globalStatus=1
fi
done < <(find .hooks src -type f -name '*.sh' -print0)
exit $globalStatus
- name: Run shellcheck
run: |
globalStatus=0
while IFS= read -r -d '' f; do
if ! uv run shellcheck --external-sources --exclude=SC2034 -- "$f"; then
echo "[ERROR] shellcheck failed for $f"
globalStatus=1
fi
done < <(find .hooks src -type f -name '*.sh' -print0)
exit $globalStatus