From 364ee0b7b4ae26c682d40a1feffacf2fcc6dceaa Mon Sep 17 00:00:00 2001 From: Edgars Date: Thu, 9 Apr 2026 14:18:58 +0100 Subject: [PATCH] fix: allow CI to pass for fork PRs Fork PRs don't have access to repo secrets, causing Codecov and SonarCloud steps to fail even when tests pass. Make Codecov upload non-blocking and skip SonarCloud for fork PRs. --- .github/workflows/frontend-unit-tests.yml | 4 ++-- .github/workflows/unit-tests-pr.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frontend-unit-tests.yml b/.github/workflows/frontend-unit-tests.yml index 52313d475..28e502998 100644 --- a/.github/workflows/frontend-unit-tests.yml +++ b/.github/workflows/frontend-unit-tests.yml @@ -4,7 +4,7 @@ on: workflow_call: secrets: codecov_token: - required: true + required: false jobs: frontend: @@ -32,5 +32,5 @@ jobs: with: verbose: true token: ${{ secrets.codecov_token }} - fail_ci_if_error: true + fail_ci_if_error: false directory: frontend/coverage diff --git a/.github/workflows/unit-tests-pr.yml b/.github/workflows/unit-tests-pr.yml index 5b4ab9613..7eca3c271 100644 --- a/.github/workflows/unit-tests-pr.yml +++ b/.github/workflows/unit-tests-pr.yml @@ -34,6 +34,7 @@ jobs: - run: pip install pytest-cov pytest-xdist - run: pytest tests/unit --cov=backend --cov-report=xml --cov-branch -n auto - name: SonarCloud Scan + if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' uses: sonarsource/sonarqube-scan-action@v7.0.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}