Removing project creation step.
This commit is contained in:
@@ -20,31 +20,26 @@ jobs:
|
|||||||
ls -la
|
ls -la
|
||||||
echo "Working in directory: $(pwd)"
|
echo "Working in directory: $(pwd)"
|
||||||
|
|
||||||
- name: Create SonarQube Project (if not exists)
|
- name: SonarQube Scan
|
||||||
env:
|
uses: kitabisa/sonarqube-action@v1.2.0
|
||||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
with:
|
||||||
SONAR_URL: ${{ secrets.SONARQUBE_URL }}
|
host: ${{ secrets.SONARQUBE_HOST }}
|
||||||
run: |
|
login: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
echo "Attempting to create SonarQube project if it doesn't exist..."
|
|
||||||
RESPONSE=$(curl -s -X POST -u "$SONAR_TOKEN:" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"$SONAR_URL/api/projects/create?project=${{ gitea.repository.name }}&name=${{ gitea.repository.name }}" || echo "Request failed")
|
|
||||||
echo "Response: $RESPONSE"
|
|
||||||
|
|
||||||
- name: Run SonarQube Analysis
|
# - name: Run SonarQube Analysis
|
||||||
env:
|
# env:
|
||||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
# SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
SONAR_URL: ${{ secrets.SONARQUBE_URL }}
|
# SONAR_URL: ${{ secrets.SONARQUBE_URL }}
|
||||||
run: |
|
# run: |
|
||||||
echo "Starting SonarQube analysis..."
|
# echo "Starting SonarQube analysis..."
|
||||||
sonar-scanner \
|
# sonar-scanner \
|
||||||
-Dsonar.projectKey=${{ gitea.repository.name }} \
|
# -Dsonar.projectKey=${{ gitea.repository.name }} \
|
||||||
-Dsonar.sources=. \
|
# -Dsonar.sources=. \
|
||||||
-Dsonar.language=docker \
|
# -Dsonar.language=docker \
|
||||||
-Dsonar.host.url=$SONAR_URL \
|
# -Dsonar.host.url=$SONAR_URL \
|
||||||
-Dsonar.login=$SONAR_TOKEN \
|
# -Dsonar.login=$SONAR_TOKEN \
|
||||||
-X
|
# -X
|
||||||
echo "SonarQube analysis completed."
|
# echo "SonarQube analysis completed."
|
||||||
|
|
||||||
- name: Comment on PR with SonarQube Status
|
- name: Comment on PR with SonarQube Status
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user