Skip to content

Commit 3760ff3

Browse files
committed
Fix pre-commit workflow for push events
1 parent 2e3c912 commit 3760ff3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ jobs:
2323
python3 -m pip install -r requirements.txt
2424
- name: Run pre-commit checks
2525
run: |
26-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
27-
pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD
26+
FROM_REF="${{ github.base_ref || 'HEAD~1' }}"
27+
git fetch origin $FROM_REF:$FROM_REF || true
28+
pre-commit run --from-ref $FROM_REF --to-ref HEAD

0 commit comments

Comments
 (0)