Update SonarQube workflow to trigger on push events for all branches and modify project key references in API calls for consistency.
Some checks failed
SonarQube / Build and analyze (push) Failing after 3m1s
Some checks failed
SonarQube / Build and analyze (push) Failing after 3m1s
This commit is contained in:
10
.github/workflows/sonarqube.yml
vendored
10
.github/workflows/sonarqube.yml
vendored
@@ -1,11 +1,9 @@
|
|||||||
name: SonarQube
|
name: SonarQube
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- '*'
|
||||||
- main
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -78,7 +76,7 @@ jobs:
|
|||||||
|
|
||||||
# Get Quality Gate status using jq for proper JSON parsing
|
# Get Quality Gate status using jq for proper JSON parsing
|
||||||
RESPONSE=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
|
RESPONSE=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
|
||||||
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=Mrleo1nid.aiimages")
|
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=AIImages")
|
||||||
|
|
||||||
echo "API Response: $RESPONSE"
|
echo "API Response: $RESPONSE"
|
||||||
|
|
||||||
@@ -94,7 +92,7 @@ jobs:
|
|||||||
if [ "$QUALITY_GATE_STATUS" != "OK" ]; then
|
if [ "$QUALITY_GATE_STATUS" != "OK" ]; then
|
||||||
echo "❌ Quality Gate failed! Status: $QUALITY_GATE_STATUS"
|
echo "❌ Quality Gate failed! Status: $QUALITY_GATE_STATUS"
|
||||||
echo "Please check the SonarQube dashboard for details:"
|
echo "Please check the SonarQube dashboard for details:"
|
||||||
echo "${{ secrets.SONAR_HOST_URL }}/dashboard?id=Mrleo1nid.aiimages"
|
echo "${{ secrets.SONAR_HOST_URL }}/dashboard?id=AIImages"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "✅ Quality Gate passed!"
|
echo "✅ Quality Gate passed!"
|
||||||
|
|||||||
Reference in New Issue
Block a user