From 62828bb13691859dab1d57a9fcd54c706de5988d Mon Sep 17 00:00:00 2001 From: Luchesar ILIEV Date: Wed, 5 Jun 2024 23:24:13 +0300 Subject: [PATCH] ops: actions: fix pre-commmit check --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9c737f..9534058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,14 @@ jobs: run: poetry install --no-interaction - name: Run pre-commit - run: poetry run pre-commit + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: >- + if [[ $GITHUB_REF == refs/heads/main ]]; then + SKIP=no-commit-to-branch poetry run pre-commit run --all-files + else + poetry run pre-commit run --all-files + fi + - name: Run tests env: COVERAGE_FILE: .coverage.${{ matrix.python-version }}