From 37a7a02547b58feabdac12004107deae011e7814 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 3 Oct 2024 19:10:27 +0000 Subject: [PATCH] ci: Only run pre-commit on diff instead of all files Signed-off-by: Russell Bryant --- .github/workflows/pre-commit.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 84394f26db..918c07b25b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,6 +1,6 @@ name: Pre-commit -on: [push, pull_request] +on: [pull_request] jobs: pre-commit: @@ -24,5 +24,8 @@ jobs: python -m pip install --upgrade pip pip install pre-commit + - name: git fetch + run: git fetch --all + - name: Run pre-commit - run: pre-commit run --all-files + run: pre-commit run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}