It seems that the sonar.pullrequest.key is mandatory, if I don’t set it, I get an error that I need it
ERROR: Error during SonarScanner execution
ERROR: Parameter 'sonar.pullrequest.key' is mandatory for a pull request analysis
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
So going back to your question, I don’t think variables are interpolated in sonar-project.properties. But they probably will be on the analysis command line.
And, I still believe the data you need is likely to be in your env. So once you find the right variable name, you can do something like:
Yes, I found a way by using the AWS Codebuild environment variables in this case and injecting it as an argument in my Dockerfile (since I am installing and running sonar there).