From f12da91ceb13085a7ab3d93240c6810b79b2e571 Mon Sep 17 00:00:00 2001 From: jonaRumberg <66677551+jonaRumberg@users.noreply.github.com> Date: Sat, 14 Jun 2025 16:45:50 +0200 Subject: [PATCH] make sonar python conditional --- .github/workflows/sonar_python.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/sonar_python.yaml b/.github/workflows/sonar_python.yaml index c8d7254..ffcef94 100644 --- a/.github/workflows/sonar_python.yaml +++ b/.github/workflows/sonar_python.yaml @@ -12,11 +12,26 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Check for Python files + id: check_py + run: | + if git ls-files "*.py" | grep -q "."; then + echo "Python files found" + echo "found=true" >> "$GITHUB_OUTPUT" + else + echo "No Python files found" + echo "found=false" >> "$GITHUB_OUTPUT" + fi + - name: Download coverage report + if: steps.check_py.outputs.found == 'true' uses: actions/download-artifact@v4 with: name: coverage-report + - name: SonarQube Scan + if: steps.check_py.outputs.found == 'true' uses: SonarSource/sonarqube-scan-action@v5 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}