From 6a29e6cf3b02cad48a01570e3d506bc6500b679f Mon Sep 17 00:00:00 2001 From: demo-bot Date: Mon, 13 Apr 2026 12:40:11 +0000 Subject: [PATCH] Add .gitea/workflows/sonar-scan.yaml --- .gitea/workflows/sonar-scan.yaml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitea/workflows/sonar-scan.yaml diff --git a/.gitea/workflows/sonar-scan.yaml b/.gitea/workflows/sonar-scan.yaml new file mode 100644 index 0000000..01d3866 --- /dev/null +++ b/.gitea/workflows/sonar-scan.yaml @@ -0,0 +1,37 @@ +name: Build + +on: + push: + pull_request: + +# Cancel in-progress runs for the same branch/PR +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# Least-privilege permissions +permissions: + contents: read + pull-requests: read + +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: sonarsource/sonarqube-scan-action@v3 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_SCANNER_JSON_PARAMS: '{"sonar.projectKey":"demo-platform"}' + + # Fail the build if Quality Gate is red + - uses: sonarsource/sonarqube-quality-gate-action@v1 + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file