name: Official SonarQube Scan description: > Scan your code with SonarQube to detect Bugs, Vulnerabilities and Code Smells in up to 27 programming languages! branding: icon: check color: green inputs: args: description: Additional arguments to the sonar-scanner required: false projectBaseDir: description: Set the sonar.projectBaseDir analysis property required: false scannerVersion: description: Version of the Sonar Scanner CLI to use required: false default: 6.2.1.4610 runs: using: "composite" steps: - name: Sanity checks run: ${GITHUB_ACTION_PATH}/sanity-checks.sh shell: bash env: INPUT_PROJECTBASEDIR: ${{ inputs.projectBaseDir }} - name: Load Sonar Scanner CLI from cache id: sonar-scanner-cli uses: actions/cache@v4.0.2 with: path: ${{ runner.temp }}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }} key: sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }} - name: Install Sonar Scanner CLI if: steps.sonar-scanner-cli.outputs.cache-hit != 'true' run: ${GITHUB_ACTION_PATH}/install-sonar-scanner-cli.sh shell: bash env: INPUT_SCANNERVERSION: ${{ inputs.scannerVersion }} - name: Add SonarScanner CLI to the PATH run: echo "${RUNNER_TEMP}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/bin" >> $GITHUB_PATH shell: bash - name: Run SonarScanner run: ${GITHUB_ACTION_PATH}/run-sonar-scanner.sh ${{ inputs.args }} shell: bash env: INPUT_PROJECTBASEDIR: ${{ inputs.projectBaseDir }} SONAR_SCANNER_JRE: ${{ runner.temp }}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/jre