Update .gitea/workflows/sonar.yml
All checks were successful
SonarQube Analysis / SonarQube Scan (push) Successful in 28s
All checks were successful
SonarQube Analysis / SonarQube Scan (push) Successful in 28s
This commit is contained in:
@@ -25,21 +25,40 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run SonarScanner (Docker v12)
|
||||
run: |
|
||||
# Safely get repository name from current directory
|
||||
PROJECT_KEY=$(basename "$PWD")
|
||||
# - 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.0.0.3214_8.0.1 \
|
||||
# -Dsonar.projectKey=$PROJECT_KEY \
|
||||
# -Dsonar.projectName=$PROJECT_KEY \
|
||||
# -Dsonar.sources=. \
|
||||
# -Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
|
||||
# -Dsonar.qualitygate.wait=true
|
||||
|
||||
echo "Using project key: $PROJECT_KEY"
|
||||
- name: Run SonarScanner (Fixed for Gitea)
|
||||
run: |
|
||||
# Use Gitea-native repo name
|
||||
REPO_NAME=${{ gitea.event.repository.name }}
|
||||
|
||||
docker run --rm \
|
||||
-v "$PWD:/usr/src" \
|
||||
--user root \
|
||||
-v "${{ gitea.workspace }}:/usr/src" \
|
||||
-w /usr/src \
|
||||
-e SONAR_HOST_URL=${{ secrets.SONARQUBE_HOST }} \
|
||||
-e SONAR_TOKEN=${{ secrets.SONARQUBE_TOKEN }} \
|
||||
sonarsource/sonar-scanner-cli:12.0.0.3214_8.0.1 \
|
||||
-Dsonar.projectKey=$PROJECT_KEY \
|
||||
-Dsonar.projectName=$PROJECT_KEY \
|
||||
-Dsonar.projectKey=$REPO_NAME \
|
||||
-Dsonar.projectName=$REPO_NAME \
|
||||
-Dsonar.sources=. \
|
||||
-Dsonar.scm.disabled=true \
|
||||
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
|
||||
-Dsonar.qualitygate.wait=true
|
||||
|
||||
Reference in New Issue
Block a user