ci: report sonar branch name
Some checks failed
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Failing after 3s
build-and-push / docker (push) Has been skipped

This commit is contained in:
nocci 2025-12-31 10:22:42 +00:00
parent c486f45bc0
commit 4c255a8258

View file

@ -46,6 +46,7 @@ jobs:
run: |
WORKDIR=${GITHUB_WORKSPACE:-$PWD}
HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set}
BRANCH_NAME=${GITHUB_REF#refs/heads/}
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')
@ -64,6 +65,7 @@ jobs:
-Dsonar.host.url="$HOST_URL" \
-Dsonar.token="$SONAR_TOKEN" \
-Dsonar.projectKey="$PROJECT_KEY" \
-Dsonar.branch.name="$BRANCH_NAME" \
-Dsonar.sources=. \
-Dsonar.scm.disabled=true \
-Dsonar.projectBaseDir="$WORKDIR"