From 7337a826c26576252b37ecf50a52b62e56f23f4d 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 | 22 ++++++++++++++++++++++ sonar-project.properties | 4 ++++ 2 files changed, 26 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..df2e7ae0a --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,22 @@ +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: + name: SonarQube scan + runs-on: ip-range-controlled + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - 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..e185f3656 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=inspec_magic-modules_AYzVMaVMhXuvzhhRmNV6 +sonar.projectName=Chef-Inspec-magic-modules + +sonar.sources=. \ No newline at end of file