My specs :
SonarQube Community Edition v10.6 (92116)
Deployment : SonarQube zip behind systemctl on Ubuntu
I’m trying to change the master branch on my project. The master branch is currently “master
”, and this branch does not exits in my project. The master branch is “main
”.
I’ve read on Can I update the Main branch from "master" to "main" without deleting the main branch? that some features were on the way to switch master branches.
How could I switch branches on SonarQube Community Edition v10.6 ?
Colin
(Colin)
October 29, 2024, 11:39am
2
Hey there.
You can rename the branch, but you’ll have to use the Web API.
Hi,
You can use the api/project_branches/rename web service. It’s not exposed in the UI in CE (because we didn’t think it would be needed) but it’s available. You’ll find the on-board Web API docs linked from the page footer.
HTH,
Ann
1 Like
Thank you, I used the API as you said, but with the api/project_branches/set_main
endpoint.
For future references :
#/bin/bash
ADMIN_TOKEN="squ_xxx"
SONAR_URL="sonar.example.com"
PROJECT_ID="project-id"
curl -u $ADMIN_TOKEN: -X POST "$SONAR_URL/api/project_branches/set_main?branch=main&project=$PROJECT_ID"
1 Like
Colin
(Colin)
October 30, 2024, 3:50pm
4
Thanks for the update. It wasn’t clear to me we added this API to Community Edition. I learned something!
system
(system)
Closed
November 6, 2024, 3:50pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.