From bcb3110e036a1ec6813b5abcf4de050b24bf19d2 Mon Sep 17 00:00:00 2001 From: Patrick de Ruiter Date: Sat, 1 Nov 2025 20:36:15 +0100 Subject: [PATCH] Fix SonarQube scan Java version mismatch - Updated SonarQube action from kitabisa/sonarqube-action@v1.2.0 to sonarsource/sonarqube-scan-action@v4 - Official action uses Java 17, compatible with SonarQube 25.10 - Added sonar-project.properties with Terraform-specific exclusions - Fixes: java.lang.UnsupportedClassVersionError (class file version 61.0 vs 55.0) --- .gitea/workflows/sonarqube.yaml | 8 ++++---- sonar-project.properties | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 sonar-project.properties diff --git a/.gitea/workflows/sonarqube.yaml b/.gitea/workflows/sonarqube.yaml index bc25f1d..21891fc 100644 --- a/.gitea/workflows/sonarqube.yaml +++ b/.gitea/workflows/sonarqube.yaml @@ -17,7 +17,7 @@ jobs: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 - name: SonarQube Scan - uses: kitabisa/sonarqube-action@v1.2.0 - with: - host: ${{ secrets.SONARQUBE_HOST }} - login: ${{ secrets.SONARQUBE_TOKEN }} + uses: sonarsource/sonarqube-scan-action@v4 + env: + SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }} + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..14ad40e --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +# SonarQube Project Configuration +sonar.projectKey=terraform-vsphere-resourcegroups +sonar.projectName=Terraform vSphere Resource Groups +sonar.projectVersion=1.0 + +# Source code location +sonar.sources=. + +# Exclusions +sonar.exclusions=**/.terraform/**,**/*.tfstate,**/*.tfstate.backup,**/.gitea/** + +# Terraform specific settings +sonar.sourceEncoding=UTF-8