From 9edb250662e858242f10b6e34a5892d65c967442 Mon Sep 17 00:00:00 2001 From: Edd Almond <102675624+eddalmond1@users.noreply.github.com> Date: Wed, 27 Aug 2025 15:04:21 +0100 Subject: [PATCH] chore - adding workflow to run static analysis on main, when changes are pushed to main --- .../workflows/sonarcube-scan-main-branch.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/sonarcube-scan-main-branch.yaml diff --git a/.github/workflows/sonarcube-scan-main-branch.yaml b/.github/workflows/sonarcube-scan-main-branch.yaml new file mode 100644 index 000000000..7b1831be9 --- /dev/null +++ b/.github/workflows/sonarcube-scan-main-branch.yaml @@ -0,0 +1,31 @@ +name: Sonar static analysis (main) + +on: + push: + branches: [ main ] + workflow_dispatch: {} + +permissions: + contents: read + +concurrency: + group: sonar-main-${{ github.ref }} + cancel-in-progress: true + +jobs: + sonar_main: + runs-on: ubuntu-latest + steps: + - name: Checkout (full history) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run static analysis script + env: + BRANCH_NAME: main + SONAR_ORGANISATION_KEY: ${{ secrets.SONAR_ORGANISATION_KEY }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + FORCE_USE_DOCKER: "true" + run: ./scripts/reports/perform-static-analysis.sh