From 5b1d966c6e7569658ff9f5920a4ab383ce954905 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 12:40:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20enhance=20sonar=20s?= =?UTF-8?q?canner=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - extract project key from properties file for dynamic setup - add projectBaseDir to sonar scanner command for accurate analysis --- .forgejo/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 882e541..a251a62 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -33,6 +33,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | + PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') docker run --rm \ -e SONAR_HOST_URL="$SONAR_HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -41,7 +42,9 @@ jobs: sonarsource/sonar-scanner-cli \ sonar-scanner \ -Dsonar.host.url="$SONAR_HOST_URL" \ - -Dsonar.login="$SONAR_TOKEN" + -Dsonar.token="$SONAR_TOKEN" \ + -Dsonar.projectKey="${PROJECT_KEY:-free-games-claimer}" \ + -Dsonar.projectBaseDir=/usr/src docker: needs: [lint, sonar]