From 73193aba3511b640d71b7b1d79f00d03fe5a5210 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Fri, 5 Jan 2024 18:35:30 +0530 Subject: [PATCH 1/2] Configures SonarQube Signed-off-by: Vasu1105 --- .github/workflows/sonarqube.yml | 21 +++++++++++++++++++++ sonar-project.properties | 4 ++++ 2 files changed, 25 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..878a20ba7 --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,21 @@ +name: Sonarqube + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarqube: + name: SonarQube + runs-on: ubuntu-latest + 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 }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..494fec43b --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=inspec_magic-modules_AYztYbRUhXuvzhhRmNvE +sonar.projectName=Chef-Inspec-magic-modules + +sonar.sources=. \ No newline at end of file From 32d25e4887bf41b1d0af605d874ad38e8041ab25 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 9 Jan 2024 14:35:32 +0530 Subject: [PATCH 2/2] update runs-on to be ip-range-controlled as adopted by other projects using github workflow Signed-off-by: Vasu1105 --- .github/workflows/sonarqube.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 878a20ba7..7a498b1f0 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -10,7 +10,8 @@ on: jobs: sonarqube: name: SonarQube - runs-on: ubuntu-latest + #runs-on: ubuntu-latest + runs-on: ip-range-controlled steps: - uses: actions/checkout@v2 with: