.scannerwork/report-task.txt does not exist in SonarQube Quality Gate check step

I’m running a SonarQube scan as part of my GitHub Actions workflow. Despite the setup, I encounter the following error in the SonarQube Quality Gate check step:

.scannerwork/report-task.txt does not exist.
Error: Process completed with exit code 1.

Here’s the relevant part of my workflow configuration:

name: SonarQube scan
on:
  push:
    branches:
      - develop
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Run SonarScan
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Generate dependency vulnerability list
        continue-on-error: true
        uses: dependency-check/Dependency-Check_Action@main
        id: depcheck
        with:
          project: 'project-name'
          path: '.'
          format: 'ALL'
          args: >
            --nodeAuditSkipDevDependencies
            --nodePackageSkipDevDependencies
      - name: SonarCloud Scan
        uses: docker://sonarsource/sonar-scanner-cli:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
      - name: SonarQube Quality Gate check
        uses: sonarsource/sonarqube-quality-gate-action@master
        # Force to fail step after specific time 
        timeout-minutes: 5
        env:
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

How we can solve this problem?

  • SonarQube version: 9.9 LTS
  • SonarQube is deployed using Docker.
  • I am trying to automate the SonarQube code analysis and quality gate check as part of my CI/CD pipeline using GitHub Actions.

Hey there.

Since you’re using SonarQube, try using the SonarQube Scan GitHub Action, rather than directly using the Docker image.