diff --git a/.gitea/workflows/sonar.yml b/.gitea/workflows/sonar.yml index cece4c3..2fe046d 100644 --- a/.gitea/workflows/sonar.yml +++ b/.gitea/workflows/sonar.yml @@ -1,21 +1,33 @@ +name: SonarQube Scan + on: push: branches: - - master + - '**' pull_request: - types: [opened, synchronize, reopened] -name: SonarQube Scan + branches: + - '**' + jobs: sonarqube: name: SonarQube Trigger runs-on: ubuntu-latest steps: - - name: Checking out - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: SonarQube Scan - uses: kitabisa/sonarqube-action@v1.2.0 - with: - host: ${{ secrets.SONARQUBE_HOST }} - login: ${{ secrets.SONARQUBE_TOKEN }} + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download SonarQube Scanner + run: | + curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip + unzip sonar-scanner.zip + + - name: Run SonarQube Scan + run: | + ./sonar-scanner-*/bin/sonar-scanner \ + -Dsonar.projectKey=ton-projet \ + -Dsonar.sources=. \ + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} \ + -Dsonar.login=${{ secrets.SONARQUBE_TOKEN }} + \ No newline at end of file