]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
revert(ci): remove SonarCloud branch rename job
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Apr 2026 22:02:42 +0000 (00:02 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Apr 2026 22:02:42 +0000 (00:02 +0200)
Token lacks 'Administer project' permission. The main branch rename
for ui-common and cli must be done by a SonarCloud org admin via:
POST https://sonarcloud.io/api/project_branches/rename
  project=e-mobility-charging-stations-simulator-ui-common&name=main
  project=e-mobility-charging-stations-simulator-cli&name=main

.github/workflows/ci.yml

index 32e39602c2892aa578a14ea9acecb5b32d4c27fb..ea7422f21841e3c2236215cc7a47ff22a7dff93c 100644 (file)
@@ -22,36 +22,6 @@ jobs:
             echo "defined=false" >> $GITHUB_OUTPUT;
           fi
 
-  # TODO: remove this job after first successful run
-  fix-sonarcloud-main-branch:
-    needs: [check-secrets]
-    if: ${{ needs.check-secrets.outputs.sonar-token-exists == 'true' && github.event_name == 'push' }}
-    runs-on: ubuntu-latest
-    steps:
-      - name: Rename SonarCloud main branch from master to main
-        env:
-          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
-        run: |
-          failed=0
-          for project in \
-            e-mobility-charging-stations-simulator-ui-common \
-            e-mobility-charging-stations-simulator-cli
-          do
-            http_code=$(curl --silent --output /dev/null --write-out '%{http_code}' \
-              --request POST \
-              'https://sonarcloud.io/api/project_branches/rename' \
-              -H "Authorization: Bearer ${SONAR_TOKEN}" \
-              -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:
       matrix: