From 17de43131c259d476b44890ac1ddc3e576398fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Fri, 24 Apr 2026 20:49:23 +0300 Subject: [PATCH] Add a basic git hooks (lint) workflow Built on https://github.com/j178/prek The config I use as starting point for similar setups can be found here: https://github.com/ulgens/python-anything/blob/162a15b286ea85d7baf9195eeb0fc37f595d589d/.pre-commit-config.yaml To keep the PR small, I added a single hook with no violations. --- .github/workflows/git-hooks.yaml | 20 ++++++++++++++++++++ .pre-commit-config.yaml | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/git-hooks.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/git-hooks.yaml b/.github/workflows/git-hooks.yaml new file mode 100644 index 0000000000..d1638bcad7 --- /dev/null +++ b/.github/workflows/git-hooks.yaml @@ -0,0 +1,20 @@ +name: "Git Hooks" + +on: + pull_request: ~ + push: + branches: + - main + +jobs: + run-prek: + name: prek run --all-files + runs-on: ubuntu-24.04 + timeout-minutes: 1 + + steps: + - name: Checkout + uses: actions/checkout@v6.0.2 + + - name: Run prek + uses: j178/prek-action@v2.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..e80d3a893d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.37.1 + hooks: + - id: check-github-workflows