👷 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
This commit is contained in:
nocci 2025-12-30 13:01:14 +00:00
parent 8626fa5a0f
commit e11d40bdda

View file

@ -34,7 +34,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
run: | run: |
HOST_URL=${SONAR_HOST_URL:-https://sonata.cyber77.de} HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set}
PROJECT_KEY="${SONAR_PROJECT_KEY}" PROJECT_KEY="${SONAR_PROJECT_KEY}"
if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then
PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r')