diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml new file mode 100644 index 00000000..3a6b4383 --- /dev/null +++ b/.github/workflows/sonar-scan.yml @@ -0,0 +1,28 @@ +name: PR Sonar Scan + +on: + push: + branches: + - main + - sonar-integration + pull_request: + +jobs: + sonar-scan: + name: Sonar Scan + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.verbose=false + -Dsonar.branch.name=${{ github.head_ref || github.ref_name }}