Hello,
We have a repository setup on SonarCloud for analysis.
We have recently moved from one main branch to several branches.
We also move the HEAD to the branch next on github and sonar.
We now have lots of branches:
-
next (HEAD) [DEV]
-
main [PROD]
-
v* [VERSION]
-
and a lot of feature branches used to create the PRs
We want to analyse:
-
Pull Requests
-
Branch (after a merge)
Here are our issues:
-
We cannot have the main branch in the long lived branches page
-
The pull requests page only show PRs from before the change (1 month ago)
-
Some feature branches are in the short lived branches (not sure if they should be there)
-
I tried to add vars to the GitHub action, but to no success
- Dsonar.branch.name=${{ github.event.pull_request.head.ref || github.ref_name }
- Dsonar.branch.target=${{ github.event.pull_request.base.ref || ‘’ }}
Can you help us setup our Github Action workflow to get to result we’re expecting ?
Do you have any method for this type of workflow ?
## e2e.yaml
name: unit + sonar + e2e tests
on:
push:
branches:
- main
- next
- 'v\*'
pull_request:
branches:
- main
- next
- 'v\*'
types: \[opened, synchronize, reopened\]
jobs:
e2e-test:
- ...
- name: SonarCloud Scan
if: success()
continue-on-error: true
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
## sonar-project.properties
sonar.organization=bearingpoint
sonar.projectKey=bearingpoint_nitro
sonar.sources=apps/webapp/,apps/webapi/,apps/webworker/,libs/webapp/,libs/webapi/
sonar.javascript.lcov.reportPaths=coverage/\*\*/lcov.info,cypress/coverage/lcov.info
sonar.exclusion=.dev-env/\*\*/\*,\*\*/entities/\*\*/\*,\*\*/migrations/\*\*/\*,\*\*/dtos/\*\*/\*,apps/\*-e2e/\*\*/\*,apps/\*-python/\*\*/\*,libs/webapp/open-api/\*\*/\*,libs/hdp-lib-api/\*\*/\*,libs/shared/\*\*/\*
Regards.