I’m running SonarQube analysis on a project through both Jenkins and GitHub Actions. I would like to know if there’s a way to fetch SonarQube project analyses based on metadata from GitHub workflows (e.g., run ID, commit SHA) or Jenkins build numbers.
Is there any supported approach or recommended API usage to filter or search projects/analyses using:
GitHub workflow run details?
Jenkins build number or other job metadata?
Appreciate any guidance or suggestions on how to achieve this.
If I add sonar.buildString in the Jenkins script/workflow script and set it to something like the Jenkins build ID or workflow ID, can I later use the SonarQube API to find the related SonarQube project or analysis using that build ID or workflow ID without project name or key?
No, you’ll have to provide the project key to APIs like GET api/project_analyses/search. I guess it’s accurate to say that it makes it easier to correlate an analysis to a run, and not so much the other way around.