I have a single GitHub account that manages 10 repositories across 2 separate projects, and I am attempting to set up 2 organizations on Sonarcloud to manage these repositories. Unfortunately, I have encountered some challenges with this process and am struggling to assign my GitHub repositories to the relevant Sonarcloud organizations. I would greatly appreciate it if I could receive some assistance in setting up my organizations, as I believe it would make the process smoother and more effective.
To provide some context, I have two organizations under my Sonarcloud account, and I currently have ten GitHub repositories. My objective is to assign five of these repositories to one of my Sonarcloud organizations and the remaining five to the other.
In summary, I need to split my ten GitHub repositories into two groups and assign each group to a different Sonarcloud organization under the same Sonarcloud account where my GitHub account is connected.
If I understand you correctly – you have two GitHub organizations that you have created SonarCloud organizations for. At that point… you just need to create the projects for each organization. Where are you running into trouble?
I am following up on the topic. Within your Github account, how many organizations do you have?
You said your GitHub account has 10 repositories and your objective is to assign 5 of these repositories to one SonarCloud organization and the remaining 5 others to another SonarCloud organization. Are the first 5 projects part of one Github organization and the other 5 projects part of another Github organization?
Thank you for the clarification.
As per SonarCloud documentation (link here)
SonarCloud is set up to mirror the way that code is organized in GitHub (and other repository providers):
Each SonarCloud project corresponds one-to-one with a Github project that resides in its own GitHub repository.
GitHub projects are grouped into GitHub organizations or personal accounts.
Each SonarCloud organization corresponds one-to-one with a GitHub organization or personal account.
So how did you import the first 5 projects into the first organization? Did you bind your Github account to that first organization? If yes, then you won’t be able to import to the other organization the 5 remaining projects, as per the documentation. Your GitHub personal account can only be bound to one SonarCloud organization.
The option I would recommend is to create two organizations on your GitHub account and transfer your first 5 projects to one organization and the remaining 5 projects to your other organization.
Then, each GitHub organization can be bound to one dedicated SonarCloud organization where you can easily import your projects.
Another option is to manually import your repositories, under the “analyse new projects section”
You will be able to select the organization for each project and thus import your 10 repositories in two different organizations.
I hugely insist on the fact that we do not recommend manual set up of projects, as it leads to missing features.