fix build
All checks were successful
SonarQube / Build and analyze (pull_request) Successful in 3m3s
Tests / Run Tests (pull_request) Successful in 2m25s

This commit is contained in:
Leonid Pershin
2025-10-22 04:20:39 +03:00
parent 96026fb69e
commit 85515b89e1
2 changed files with 52 additions and 4 deletions

View File

@@ -57,10 +57,18 @@ jobs:
echo "Waiting for SonarQube Quality Gate result..."
sleep 10
# Get Quality Gate status
QUALITY_GATE_STATUS=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=ChatBot" \
| grep -o '"status":"[^"]*"' | cut -d'"' -f4)
# 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=ChatBot")
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"