From 2cd238b05003bf20fec2abe269783cbc24c1d436 Mon Sep 17 00:00:00 2001 From: yash-infra360 Date: Fri, 16 May 2025 15:09:45 +0530 Subject: [PATCH] add pr scan workflow --- .github/workflows/pr-scan.yml | 20 ++++++++++++++++++++ .github/workflows/sonar.yml | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/pr-scan.yml create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/pr-scan.yml b/.github/workflows/pr-scan.yml new file mode 100644 index 0000000000..0cbc2b5bc2 --- /dev/null +++ b/.github/workflows/pr-scan.yml @@ -0,0 +1,20 @@ +name: PR Sonar Scan + +on: + pull_request: + branches: ["**"] + +permissions: + id-token: write + contents: write + +jobs: + sonarcloud-scan: + uses: AngelOneWealth/ci-common/.github/workflows/sonar-scan.yml@main + with: + pull-request-key: ${{ github.event.pull_request.number }} + pull-request-branch: ${{ github.head_ref }} + pull-request-base: ${{ github.base_ref }} + scm-revision: ${{ github.event.pull_request.head.sha }} + secrets: + SONAR_QUBE_ORG_TOKEN: ${{ secrets.SONAR_QUBE_ORG_TOKEN }} diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000000..64b57b2c10 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,22 @@ +name: SonarQube Scan +description: SonarQube Scan for PRs and main branch + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + id-token: write + contents: write + +jobs: + sonar: + runs-on: org-runner + steps: + - name: SonarQube Scan + uses: AngelOneWealth/ci-common/.github/actions/sonarQube@main + with: + sonar-host : ${{ github.ref == 'refs/heads/gamma' && vars.SONAR_QUBE_HOST || vars.SONAR_QUBE_DEV_HOST }} + sonar-token: ${{ secrets.SONAR_QUBE_ORG_TOKEN }}