All the steps run successfully but the scan results are always pushed to the master branch in SonarQube, ignoring completely the actual details from GitHub.
Shouldn’t this action be able to detect the branch name, the PR details, and process that info accordingly? If not, how do you suggest that I fix this?
I’m using SonarQube Developer Edition, version 8.7.1.42226.
Yes, the scanner should auto configure branches and pull request analysis based on environment variables present in github builds. Specifically, GITHUB_ACTIONS, GITHUB_REF, GITHUB_HEAD_REF and GITHUB_BASE_REF.
Do you have the logs of the scanner, preferrably with debug enabled? Can you confirm if those variables are present when the action runs?
That looks correct for a branch and the SonarQube scanner should be setting the branch name correctly.
Could you please provide the logs of the scanner with debug enabled?
The auto detection of branches and PRs in Github actions was only introduced in v8.8: https://jira.sonarsource.com/browse/SONAR-14591.
You can either upgrade or script the generation of the scanner parameters based on the environment variables.