How to create different reports

I was trying to make SonarQube.properties file dynamic based on the branch and user.
I was hoping if it was possible that sonar qube has a functionality where one can create multiple projects based on the branches or the projectkey is based on branch name of the project so that I have multiple reports based on the different user’s project.

Hi,

Welcome to the community!

I guess you’re in Community Edition? I would take a look at what environmental variables are available in your CI and see if branch name is there. Then (assuming interpolation works) you could override sonar.projectKey on the command line with something like -Dsonar.projectKey=myProjectKey{$BRANCH}

 
HTH,
Ann

I have a node js backend and react js frontend project.

sonar.projectKey=practiceproject

sonar.sourceEncoding=UTF-8

sonar.sources=src/

sonar.exclusions=src/Assets/**

sonar.language=javascript

Is It possible that I have a multiple projects based on a parameter taken from github actions

Hi,

In general I suppose it should be. However, I’m not sure that interpolation will happen to values inside a sonar-project.properties file (experimentation may be needed). I’m slightly more confident it will work on the command line.

BTW, this does nothing.

 
HTH,
Ann

Thank you.

Shivam