@@ -45,10 +45,14 @@ Those is a great SonarQube features but it assumes one of the following conditio
If you're not in one of those cases, then you shall disable this feature by setting `SONAR_BRANCH_ANALYSIS_DISABLED`.
If you leave the feature enabled, if `SONAR_GITLAB_TOKEN` is provided, the template will try to autodetect (using GitLab APIs) an opened merge request matching the current branch:
* If one is found, a SonarQube [Pull Request Analysis](https://docs.sonarqube.org/latest/analysis/pull-request/) will be made.
* Otherwise, a simple [Branch Analysis](https://docs.sonarqube.org/latest/branches/overview/) is performed on the current branch.
If you leave the feature enabled, the template will try to auto-detect whether the current branch is associated to an open Merge Request or not:
1. if you're running [Merge Request pipelines](https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines),
then the template will automatically detect the MR,
2. if you're running [branch pipelines](https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines)
instead, the template will have to call GitLab APIs to determine whether the current branch is associated to an open Merge Request.
This will only be possible if you provided `SONAR_GITLAB_TOKEN`.
Otherwise, a simple [Branch Analysis](https://docs.sonarqube.org/latest/branches/overview/) is performed on the current branch.