From 830390c8d6243aed73e3ed471103e8a6ee81940b Mon Sep 17 00:00:00 2001 From: "duc.do" Date: Mon, 30 Sep 2024 16:05:48 +0700 Subject: [PATCH] ci: add sonar workflow --- .github/workflows/sonar.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..42c1bee --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,29 @@ +name: SonarQube analysis + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +permissions: + pull-requests: read + +jobs: + Analysis: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Analyze with SonarQube + uses: SonarSource/sonarqube-scan-action@884b79409bbd464b2a59edc326a4b77dc56b2195 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + args: + -Dsonar.projectKey=Terraform-provider