I’m hosting my code on Github and using AWS Codebuild for CI. I’m trying to run sonar-scanner to analyze a pull request using these cli arguments:
I’m populating PR_NUMBER with the following shell command:
export PR_NUMBER="$(git ls-remote ssh-origin 'pull/*/head' | grep -F $HEAD_REV | cut -d'/' -f3)"
Doing this will get the wrong PR number or get multiple in some circumstances.
Do you have any advice on how to get the correct PR number?