Remove Quality Gate wait step from SonarQube workflow to simplify the analysis process and improve efficiency.
All checks were successful
SonarQube Analysis / Build and analyze (push) Successful in 1m54s

This commit is contained in:
Leonid Pershin
2025-10-31 21:06:40 +03:00
parent 8721b7bc61
commit 117f27effc

View File

@@ -67,32 +67,3 @@ jobs:
echo "Ending SonarQube analysis..."
~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Wait for Quality Gate
run: |
echo "Waiting for SonarQube Quality Gate result..."
sleep 10
# Get Quality Gate status using jq for proper JSON parsing
RESPONSE=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=AIImages")
echo "API Response: $RESPONSE"
# Install jq if not available
if ! command -v jq &> /dev/null; then
sudo apt-get update && sudo apt-get install -y jq
fi
QUALITY_GATE_STATUS=$(echo "$RESPONSE" | jq -r '.projectStatus.status')
echo "Quality Gate Status: $QUALITY_GATE_STATUS"
if [ "$QUALITY_GATE_STATUS" != "OK" ]; then
echo "❌ Quality Gate failed! Status: $QUALITY_GATE_STATUS"
echo "Please check the SonarQube dashboard for details:"
echo "${{ secrets.SONAR_HOST_URL }}/dashboard?id=AIImages"
exit 1
else
echo "✅ Quality Gate passed!"
fi