I am trying to analyze a github private repo for a .net Framework project with SonarCloud. I managed to add the following script to launch an analyse every PR.
However, whatever I push, it’s never taken into consideration my changes and it throws a 0 lines of code.
name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloudScan:
name: SonarCloudScan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=******************
-Dsonar.projectKey=Omnitech-***************
-Dsonar.verbose=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Is there a way to verify that the correct files are being analyzed by SonarCloud for each PR?
Are there any common pitfalls or mistakes that could cause SonarCloud to report 0 lines of code for my changes?
NB: I tried some solutions proposed in other issues similar to mine but it didnt’t work.