From ae723f45906e0b8a18292146d10ba583eb844e74 Mon Sep 17 00:00:00 2001 From: Paul Sanders Date: Fri, 24 Jul 2026 14:02:49 -0400 Subject: [PATCH] Switch from .pre-commit-config.yaml to prek.toml --- .github/workflows/prek_update.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/testing.yml | 7 +++++++ .pre-commit-config.yaml | 9 --------- prek.toml | 13 +++++++++++++ 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/prek_update.yml delete mode 100644 .pre-commit-config.yaml create mode 100644 prek.toml diff --git a/.github/workflows/prek_update.yml b/.github/workflows/prek_update.yml new file mode 100644 index 0000000..565bc96 --- /dev/null +++ b/.github/workflows/prek_update.yml @@ -0,0 +1,30 @@ +name: Prek Auto Update + +on: + schedule: + - cron: "0 2 * * *" + workflow_dispatch: +permissions: + contents: write + pull-requests: write +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Install prek + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.4.10/prek-installer.sh | sh + - name: Run Update + run: prek autoupdate + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ secrets.PREK_UPDATE_TOKEN }} + commit-message: "Bump prek hooks" + branch: prek-autoupdate + delete-branch: true + title: "Bump prek hooks" + body: "Automated update of prek hooks via `prek autoupdate`." + labels: | + dependencies + skip-changelog diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c60e5ee..fb72fa3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -6,6 +6,13 @@ on: - main pull_request: jobs: + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: j178/prek-action@v2 + env: + PREK_SKIP: no-commit-to-branch docker-build-and-test: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index a383d53..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,9 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: check-toml - - id: check-yaml - - id: end-of-file-fixer - - id: no-commit-to-branch - - id: trailing-whitespace diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..5060de3 --- /dev/null +++ b/prek.toml @@ -0,0 +1,13 @@ +[update] +exclude_tags = ["*-{alpha,beta,dev,rc}*", "*.{alpha,beta,dev,rc}*"] + +[[repos]] +repo = "builtin" +hooks = [ + { id = "check-added-large-files" }, + { id = "check-toml" }, + { id = "check-yaml" }, + { id = "end-of-file-fixer" }, + { id = "no-commit-to-branch" }, + { id = "trailing-whitespace" }, +]