Update build.yml #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarQube Scan | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
sonarQubeScan: | |
name: SonarQube Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' # Changed to temurin | |
java-package: 'jdk' | |
check-latest: false | |
server-id: github | |
server-username: ${{ github.actor }} | |
server-password: ${{ secrets.GITHUB_TOKEN }} | |
overwrite-settings: true | |
job-status: success | |
- name: Run SonarQube Scanner | |
uses: sonarsource/sonarqube-scan-action@v3 | |
with: | |
args: "-X" # Enable debug mode for detailed logs | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Make sure to set the SONAR_TOKEN in GitHub Secrets | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} # Make sure to set the SonarQube host URL in GitHub Secrets |