mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-10 21:07:12 +01:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
34 lines
972 B
YAML
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
|