diff --git a/.github/workflows/sonarqube-analysis.yml b/.github/workflows/sonarqube-analysis.yml new file mode 100644 index 0000000..417e606 --- /dev/null +++ b/.github/workflows/sonarqube-analysis.yml @@ -0,0 +1,30 @@ +name: SonarQube Analysis + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +jobs: + sonarqube: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v2 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + args: > + -Dsonar.projectKey=TimKenobi_${{ github.event.repository.name }} + -Dsonar.projectName=${{ github.event.repository.name }}