Closed kuamanet closed 2 years ago
Hi,
I appreciate you took time to make a pull request.
I've done some tests with the Community edition, and this is what I found out:
Solution that worked for me when running against the Community edition:
Example workflow on
statement
name: Sonarscan DotNet
# Controls when the action will run.
on:
# Triggers the workflow only on push to main
push:
branches: [ main ] #<--- ONLY TRIGGER ON PUSH TO main/master WHEN RUNNING AGAINST COMMUNITY EDITION
#pull_request: #<--- COMMENTED OUT. SKIP TRIGGER ON ALL PR WHEN RUNNING AGAINST COMMUNITY EDITION
# branches: [ main ] #<--- COMMENTED OUT. SKIP TRIGGER ON ALL PR WHEN RUNNING AGAINST COMMUNITY EDITION
As I see it there should not be any need for a code change.
In fact, the suggested code change seems to introduce risk of inconsistency. The scan result of the pull request will be appear in main/master branch in SonarQube (because Community edition doesn't support any other branches or PRs), when the code from the PR does not exist there (yet, or maybe never).
Please verify if the solution above works for you.
You are right sir, thanks for the example!
This would let the sonar community users to add this action to their github CI.