Compare commits

...

2 commits

Author SHA1 Message Date
nocci
e11d40bdda 👷 ci(build): enforce sonar host url secret presence
Some checks failed
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Failing after 6s
build-and-push / docker (push) Has been skipped
- update HOST_URL to require SONAR_HOST_URL secret for enhanced security configuration
- improve error handling by ensuring critical secrets are set
2025-12-30 13:01:14 +00:00
nocci
8626fa5a0f ♻️ refactor(build): enhance sonar scanner configuration
- set default host url for sonar scanner to ensure consistency
- add sonar.sources and sonar.scm.provider for improved analysis
2025-12-30 12:57:44 +00:00

View file

@ -34,21 +34,24 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
run: |
HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set}
PROJECT_KEY="${SONAR_PROJECT_KEY}"
if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then
PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r')
fi
PROJECT_KEY=${PROJECT_KEY:-free-games-claimer}
docker run --rm \
-e SONAR_HOST_URL="$SONAR_HOST_URL" \
-e SONAR_HOST_URL="$HOST_URL" \
-e SONAR_TOKEN="$SONAR_TOKEN" \
-v "$PWD:/usr/src" \
-w /usr/src \
sonarsource/sonar-scanner-cli \
sonar-scanner \
-Dsonar.host.url="$SONAR_HOST_URL" \
-Dsonar.host.url="$HOST_URL" \
-Dsonar.token="$SONAR_TOKEN" \
-Dsonar.projectKey="${PROJECT_KEY:-free-games-claimer}" \
-Dsonar.sources=. \
-Dsonar.scm.provider=git \
-Dsonar.projectBaseDir=/usr/src
docker: