@@ -658,9 +658,36 @@ func staticScan(p *Plugin) (*SonarReport, error) {
658658}
659659
660660func getStatus (task * TaskResponse , report * SonarReport ) string {
661- reportRequest := url.Values {
662- "analysisId" : {task .Task .AnalysisID },
661+
662+ qg_type := os .Getenv ("PLUGIN_QG_TYPE" )
663+
664+ var reportRequest url.Values
665+
666+ if qg_type == "branch" {
667+ qg_branch := os .Getenv ("PLUGIN_BRANCH" )
668+ reportRequest = url.Values {
669+ "branch" : {qg_branch },
670+ }
671+ } else if qg_type == "pullRequest" {
672+ qg_pr := os .Getenv ("PLUGIN_PR_KEY" )
673+ reportRequest = url.Values {
674+ "pullRequest" : {qg_pr },
675+ }
676+
677+ } else if qg_type == "projectKey" {
678+ qg_projectKey := os .Getenv ("PLUGIN_SONAR_KEY" )
679+ reportRequest = url.Values {
680+ "projectKey" : {qg_projectKey },
681+ }
682+ } else {
683+ reportRequest = url.Values {
684+ "analysisId" : {task .Task .AnalysisID },
685+ }
663686 }
687+
688+ // reportRequest := url.Values{
689+ // "analysisId": {task.Task.AnalysisID},
690+ // }
664691 sonarToken := os .Getenv ("PLUGIN_SONAR_TOKEN" )
665692
666693 // First try with Basic Auth
0 commit comments