From 1b9e11303a703589d26a131d6108422c7358ed80 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Fri, 5 Jan 2024 18:35:30 +0530 Subject: [PATCH] Configures SonarQube Signed-off-by: Vasu1105 --- .github/workflows/sonarqube.yml | 28 ++++++++++++++++++++++++++++ sonar-project.properties | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/sonarqube.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 000000000..1b55cd35b --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,28 @@ +name: SonarQube scan + +on: + # Trigger analysis when pushing to your main branches, and when creating a pull request. + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarqube: + # this fails for all users - internal and external - with: + # ERROR: You're not authorized to run analysis. Please contact the project administrator. + # + # So disabling for now until someone looks into this. + if: ${{ false }} + runs-on: ip-range-controlled + steps: + - uses: actions/checkout@v4 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..0a99f6934 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=inspec_magic-modules_AYzVMaVMhXuvzhhRmNV6 +sonar.projectName=Chef-Inspec-magic-modules \ No newline at end of file