diet-guard/.github/workflows/pre-commit.yml
Krzysztof kuhy Rudnicki 953f03f6e0 One Python, always the newest
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 20:05:38 +02:00

34 lines
972 B
YAML

name: pre-commit
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip install -r requirements.txt
# The file-length hook delegates to the shared gate in kuhyx/utils, which
# a runner does not have at $HOME/utils. Check it out and point the shim
# at it via UTILS_ROOT, or `pre-commit run --all-files` fails on a
# missing checker rather than on anything in this repo. `.utils` is in
# the gate's own EXCLUDED_DIRS, so it does not lint itself.
- name: Check out the shared gate
uses: actions/checkout@v4
with:
repository: kuhyx/utils
path: .utils
- uses: pre-commit/action@v3.0.1
env:
UTILS_ROOT: ${{ github.workspace }}/.utils