Sonarqube-developer- Edition Not able to push from GITHUB to Sonarqube

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) :


  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
    we are trying to integrate Sonarqube with GITHUB
  • what have you tried so far to achieve this
    we configured the projects and updated the workflow file build.yml file in GITHUB actions .

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Build succeeded.

D:\a\CleanArchitecture\CleanArchitecture\CleanArchitecture.Persistence\Repositories\BaseRepository.cs(36,16): warning CS8603: Possible null reference return. [D:\a\CleanArchitecture\CleanArchitecture\CleanArchitecture.Persistence\CleanArchitecture.Persistence.csproj]
D:\a\CleanArchitecture\CleanArchitecture\CleanArchitecture.Persistence\Repositories\UserRepository.cs(16,16): warning CS8603: Possible null reference return. [D:\a\CleanArchitecture\CleanArchitecture\CleanArchitecture.Persistence\CleanArchitecture.Persistence.csproj]
2 Warning(s)
0 Error(s)

Time Elapsed 00:01:33.56
SonarScanner for MSBuild 6.1
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
08:55:55.653 SonarQube analysis could not be completed because the analysis configuration file could not be found: D:\a\CleanArchitecture\CleanArchitecture.sonarqube\conf\SonarQubeAnalysisConfig.xml.
08:55:55.654 Post-processing failed. Exit code: 1
Error: Process completed with exit code 1.

Can you share your GitHub Actions YML file?

name: SonarqubeScan Build

      - master
    types: [opened, synchronize, reopened]

    name: Build
    runs-on: windows-latest
    permissions: read-all
      - uses: actions/checkout@v2
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK 17
        uses: actions/setup-java@v1
          java-version: 17
      - name: Cache SonarQube packages
        uses: actions/cache@v1
          path: ~\.sonar\cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Cache SonarQube scanner
        id: cache-sonar-scanner
        uses: actions/cache@v1
          path: .\.sonar\scanner
          key: ${{ runner.os }}-sonar-scanner
          restore-keys: ${{ runner.os }}-sonar-scanner
      - name: Install SonarQube scanner
        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
        shell: powershell
        run: |
          New-Item -Path .\.sonar\scanner -ItemType Directory
          dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
      - name: Build and analyze
        shell: powershell
        run: |
          .\.sonar\scanner\dotnet-sonarscanner begin /k:"VenkataSiva0326_BankApplication_ef497eef-bc23-4f9e-8680-49ffbb2fc0f1" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /"${{ secrets.SONAR_HOST_URL }}"
          dotnet build
          .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

The above YAML file i configured in Github Actions

Below is the repo i am trying to integrate with sonarqube

Now we are able to Connect from GITHUB to Sonarqube with the above YAML file …Thanks

1 Like