"dev" branch has not been analyzed yet and you have multiple branches already. It looks like it is n

  • versions used (SonarQube -

Recently upgraded to Development version and tried to set up SonarQube as per documentation.

Using Github actions for CI

SonarQube set up was done as per the documentation:

  • error observed - “dev” branch has not been analyzed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.

Can anyone help me to fix this issue please.

Hey there.

How is your GitHub Actions YML file configured? Feel free to paste it here.

name: Sonar-Analysis
- dev
types: [opened, edited, synchronize, reopened]
name: Sonar-Analysis
runs-on: ubuntu-latest
- uses: actions/checkout@v2.2.0
# Disabling shallow clone is recommended for improving relevancy of sonarqube reporting
fetch-depth: 0

  - name: Setup dotnet
    uses: actions/setup-dotnet@v1
      dotnet-version: '5.0.x'

  - name: Install dependencies
    run: dotnet restore

  - name: SonarQube Begin
    run: | 
      dotnet tool install --global dotnet-sonarscanner
      dotnet sonarscanner begin /k:"xxxxxxxxxxxxxxxxxxxx" /d:sonar.login=${{ secrets.SONAR_TOKEN }} /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml /d:sonar.verbose=true
  - name: Build
    run: dotnet build

  # - name: Test with the dotnet CLI
  #   run: dotnet test --settings coverlet.runsettings --logger:trx
  #   env:

  - name: SonarQube end
    run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     ##      Please advise if I have to make any changes.

So it looks like your conditions to run the job only include pull requests that target the dev branch, not pushes to the dev branch itself.

A better condition would be:

      - dev
    types: [opened, synchronize, reopened]

Thank you Colin, I am implementing the changes and will post in case if there is any error.

I have implemented the changes and it worked , just wanted to check with one warning thats displayed. could you please comment on the below warning message.

HI, could you please help me how to make sure that my sonar is updated to the latest date.

The date shows as June 6 however the PR shows the correct date, could you suggest if there is any setting that needs to be updated.