Compare commits
4 Commits
dependabot
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b823a75886 | |||
| 60f0f542d4 | |||
| cc860b15ee | |||
| 645c5f7bff |
45
.gitea/workflows/sonar.yml
Normal file
45
.gitea/workflows/sonar.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: SonarQube Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
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
|
||||
Reference in New Issue
Block a user