From 1b7aa5d13d9de25d5e4911e91932461411557105 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 1 Nov 2026 10:02:52 +1000 Subject: [PATCH 1/2] [CI] Switch to prek-action workflow Add a separate workflow for the manual hooks --- .github/workflows/pre-commit-manual.yml | 42 +++++++++++++++++++++++++ .github/workflows/pre-commit.yml | 25 +++------------ 2 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/pre-commit-manual.yml diff --git a/.github/workflows/pre-commit-manual.yml b/.github/workflows/pre-commit-manual.yml new file mode 100644 index 000000000000..426a418d272a --- /dev/null +++ b/.github/workflows/pre-commit-manual.yml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: pre-commit manual + +on: [pull_request] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + pre-commit: + name: Run pre-commit + runs-on: ubuntu-24.04 + steps: + - name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )' + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0 + with: + install-only: true + - name: Run manual pre-commit hooks + run: prek run --color=always --all-files --hook-stage manual diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4de995479c59..00b7497d4a51 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -24,32 +24,17 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: pre-commit: name: Run pre-commit runs-on: ubuntu-24.04 steps: - - name: Check Out - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )' + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0 with: - python-version: '3.11' - cache: 'pip' - - name: Install - run: pip install pre-commit - - name: Set PY - run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - name: Cache pre-commit environments - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ~/.cache/pre-commit - key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - name: Run pre-commit - run: pre-commit run --color=always --all-files - - name: Run manual pre-commit hooks - run: pre-commit run --color=always --all-files --hook-stage manual + extra-args: --all-files From 4ddc813403ea1af03352400300c525281917493e Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 1 Nov 2026 10:20:46 +1000 Subject: [PATCH 2/2] Fixups --- .../workflows/{pre-commit-manual.yml => prek-manual.yml} | 8 ++++---- .github/workflows/{pre-commit.yml => prek.yml} | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename .github/workflows/{pre-commit-manual.yml => prek-manual.yml} (93%) rename .github/workflows/{pre-commit.yml => prek.yml} (95%) diff --git a/.github/workflows/pre-commit-manual.yml b/.github/workflows/prek-manual.yml similarity index 93% rename from .github/workflows/pre-commit-manual.yml rename to .github/workflows/prek-manual.yml index 426a418d272a..53a28f8c5119 100644 --- a/.github/workflows/pre-commit-manual.yml +++ b/.github/workflows/prek-manual.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -name: pre-commit manual +name: prek manual on: [pull_request] @@ -27,8 +27,8 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - pre-commit: - name: Run pre-commit + prek-manual: + name: Run prek manual hooks runs-on: ubuntu-24.04 steps: - name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )' @@ -38,5 +38,5 @@ jobs: - uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0 with: install-only: true - - name: Run manual pre-commit hooks + - name: Run manual prek hooks run: prek run --color=always --all-files --hook-stage manual diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/prek.yml similarity index 95% rename from .github/workflows/pre-commit.yml rename to .github/workflows/prek.yml index 00b7497d4a51..e4e798e9a5bc 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/prek.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -name: pre-commit +name: prek standard on: [pull_request] @@ -27,8 +27,8 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - pre-commit: - name: Run pre-commit + prek: + name: Run prek standard hooks runs-on: ubuntu-24.04 steps: - name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'