]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
ci: retry SonarCloud branch rename for ui-common and cli only
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Apr 2026 21:58:39 +0000 (23:58 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Apr 2026 21:58:39 +0000 (23:58 +0200)
Root and webui already have main as their main branch. Target only
the two remaining projects. Emit warning instead of silent success
on failure.

.github/workflows/ci.yml

index 8622f6988acc3ee043a2060d0de0970253bc5fde..32e39602c2892aa578a14ea9acecb5b32d4c27fb 100644 (file)
@@ -32,11 +32,10 @@ jobs:
         env:
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
         run: |
+          failed=0
           for project in \
-            e-mobility-charging-stations-simulator \
             e-mobility-charging-stations-simulator-ui-common \
-            e-mobility-charging-stations-simulator-cli \
-            e-mobility-charging-stations-simulator-webui
+            e-mobility-charging-stations-simulator-cli
           do
             http_code=$(curl --silent --output /dev/null --write-out '%{http_code}' \
               --request POST \
@@ -45,7 +44,13 @@ jobs:
               -H 'Content-Type: application/x-www-form-urlencoded' \
               -d "project=${project}&name=main")
             echo "${project}: HTTP ${http_code}"
+            if [ "$http_code" != "204" ] && [ "$http_code" != "200" ]; then
+              failed=1
+            fi
           done
+          if [ "$failed" = "1" ]; then
+            echo "::warning::Some SonarCloud branch renames failed. The SONAR_TOKEN may lack 'Administer project' permission."
+          fi
 
   build-ocpp-server:
     strategy: