- Sonar version: Enterprise Edition v9.9.7
- ALM used: GitHub
- CI system used: Github Actions
- Scanner command
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Override sonar coverage exclusions for master
if: github.event_name == 'push'
run: echo "SONAR_COVERAGE_EXCLUSIONS=-Dsonar.coverage.exclusions=**/*Config.java" >> $GITHUB_ENV
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_ENTERPRISE }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL_ENTERPRISE }}
REPORT_API_KEY: ${{ secrets.RP_API_KEY }}
run: |
start_time=$(date +%s)
unset GOOGLE_APPLICATION_CREDENTIALS
mvn -B -T 1C clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar -Dsonar.projectKey=${{ github.event.repository.name }} -Dsonar.projectName=${{ github.event.repository.name }} ${{ env.SONAR_COVERAGE_EXCLUSIONS }} -Dproject.version=x.x.x -Dnexus.username=${{ secrets.NEXUS_USER }} -Dnexus.password=${{ secrets.NEXUS_PWD }}
end_time=$(date +%s)
duration_minutes=$(( (end_time - start_time) / 60 ))
echo "Total time: $duration_minutes minutes."
-
Languages of the repository : Java
-
Error observed
Sonarqube status remains stuck in pending state,Expected : Waiting for status to be reported
even when analysis has run and posted a summary on PR and with a warning on sonarqube dashboardPull request decoration failed. Commit 'abc' not found in pull request 'xyz'
- Potential workaround
Already visited : Pull request decoration failed. Commit xxx not found in pull request xxx
but not been able to relate with my current worlflow
- Short term fix: We are currently pushing a empty commit to re trigger wf, as sonar gets new commit id.
Please help with a solution.