Files
test-product-compare-react/.gitea/workflows/sonar.yml
Rajendra Reddy e66e062370
All checks were successful
SonarQube Analysis / SonarQube Scan (push) Successful in 29s
Update .gitea/workflows/sonar.yml
2026-02-18 14:53:30 +00:00

46 lines
1.0 KiB
YAML

name: SonarQube Analysis
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
jobs:
sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run SonarScanner (Docker v12)
run: |
# Safely get repository name from current directory
PROJECT_KEY=$(basename "$PWD")
echo "Using project key: $PROJECT_KEY"
docker run --rm \
-v "$PWD:/usr/src" \
-w /usr/src \
-e SONAR_HOST_URL=${{ secrets.SONARQUBE_HOST }} \
-e SONAR_TOKEN=${{ secrets.SONARQUBE_TOKEN }} \
sonarsource/sonar-scanner-cli:12 \
-Dsonar.projectKey=$PROJECT_KEY \
-Dsonar.projectName=$PROJECT_KEY \
-Dsonar.sources=. \
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
-Dsonar.qualitygate.wait=true