diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..8bd711b --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,35 @@ +name: Sonar Scan + +on: + pull_request: + branches: + - main + types: + - opened + - synchronize + - reopened + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pull-requests: read + +jobs: + sonar: + name: Sonar Scan + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + # actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 + with: + fetch-depth: 0 + + - name: SonarQube Scan + # SonarSource/sonarqube-scan-action@v8.2.0 + uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..cd9e031 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.organization=randomcodespace +sonar.projectKey=RandomCodeSpace_lane +sonar.projectName=Lane +sonar.sources=src,bin,.github +sonar.exclusions=target/**,node_modules/**,docs/**,.superpowers/** +sonar.sourceEncoding=UTF-8