- When running in GitLab CI SonarQube uses a mechanism of its
own to determine the “correct” branch name.
- This is triggered when:
sonar.branch.name is empty or not given at all and
- the environment variable
- Then SonarQube will set
- In the case of a
tag build in GitLab this unfortunately has the effect
version is set on a branch called
CI_COMMIT_REF_NAME because then
CI_COMMIT_REF_NAME is identical to
- These branches are not kept in general so:
version is not visible on the “MAIN BRANCH” and at the same time
- “new code measures” are reported wrongly as well as they are calculated as issues since the last version on the same branch.