From be9396df066033ea086d243ae5b58fcd92f1c4c4 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Mon, 30 Jun 2025 16:57:59 +0200 Subject: [PATCH] [CI] Do not run 'pre-commit' job on post commit --- .github/workflows/ubuntu.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9bb41cf48..2bb30f207 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,6 +4,7 @@ on: jobs: pre-commit: runs-on: ubuntu-24.04 + if: github.event_name != 'push' steps: - uses: actions/checkout@v4 with: @@ -17,14 +18,8 @@ jobs: python3 -m pip install -r requirements.txt - name: Run pre-commit checks run: | - # For push events, compare with previous commit - if [ "${{ github.event_name }}" = "push" ]; then - pre-commit run --from-ref HEAD~1 --to-ref HEAD - else - # For PRs, compare with base branch - git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} - pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD - fi + git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} + pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD gcc-build: needs: - pre-commit