👷 ci(build): enhance sonar scanner configuration
- extract project key from properties file for dynamic setup - add projectBaseDir to sonar scanner command for accurate analysis
This commit is contained in:
parent
d40a577f47
commit
5b1d966c6e
1 changed files with 4 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue