-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: fix sonarcloud scan pr source #85
Conversation
c64c910
to
e0499b1
Compare
There are a few things to consider here. I guess you found this page, but another page mentions The scan action seems to have access to Here are action logs showing the event name:
Then there's this issue https://github.com/SonarSource/sonarqube-scan-action/issues/29 which also mentions that I tried looking finding where these variables are used, but couldn't find anything at first glance in https://github.com/SonarSource/sonar-scanner-cli or https://github.com/SonarSource/sonar-scanner-commons I'm not saying your change won't work, but I think the culprit actually is sonarcloud here. So I'd propose that you open an issue (or reopen the one I linked). |
I agree with you that sonar should already have all the necessary information but I dont think that this is sonar's fault. We are doing an unconventional checkout here: cluster-api-provider-proxmox/.github/workflows/test.yml Lines 22 to 29 in 01b3f7f
This is a workaround for branches across forks, my theory is that this confuses the sonar scan. I don't know how one would solve that properly |
Old thread but it doesn't seem like much has changed since and sonarcloud still doesn't support |
.github/workflows/test.yml
Outdated
args: > | ||
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | ||
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be sufficient.
c8708fd
to
208e6a2
Compare
Yeah, that's what I figured. I thought that opening an issue would shed some light on this |
208e6a2
to
82072ea
Compare
Looks good to me, tested in a test-PR: #91 |
Sonarcloud thinks that every branch is "main" (see https://sonarcloud.io/project/branches_list?id=ionos-cloud_cluster-api-provider-proxmox)
This is an attempt to fix that
Warning: the check run here uses the workflow from main, so I cant be sure if this works. I'd be happy to receive other suggestions