Skip to content

Commit 9c29546

Browse files
branch + pr qg fix - add projectkey
1 parent 225e1c9 commit 9c29546

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,22 +660,24 @@ func staticScan(p *Plugin) (*SonarReport, error) {
660660
func getStatus(task *TaskResponse, report *SonarReport) string {
661661

662662
qg_type := os.Getenv("PLUGIN_QG_TYPE")
663+
qg_projectKey := os.Getenv("PLUGIN_SONAR_KEY")
663664

664665
var reportRequest url.Values
665666

666667
if qg_type == "branch" {
667668
qg_branch := os.Getenv("PLUGIN_BRANCH")
668669
reportRequest = url.Values{
669-
"branch": {qg_branch},
670+
"branch": {qg_branch},
671+
"projectKey": {qg_projectKey},
670672
}
671673
} else if qg_type == "pullRequest" {
672674
qg_pr := os.Getenv("PLUGIN_PR_KEY")
673675
reportRequest = url.Values{
674676
"pullRequest": {qg_pr},
677+
"projectKey": {qg_projectKey},
675678
}
676679

677680
} else if qg_type == "projectKey" {
678-
qg_projectKey := os.Getenv("PLUGIN_SONAR_KEY")
679681
reportRequest = url.Values{
680682
"projectKey": {qg_projectKey},
681683
}

0 commit comments

Comments
 (0)