Skip to content

Commit

Permalink
VCI-237: Fix sonar.branch.target parameter passing (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro authored Dec 17, 2021
1 parent 6df86a0 commit dbbb53c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/VirtoCommerce.Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -898,17 +898,30 @@ private async Task<string> SendSwaggerSchemaToValidator(HttpClient httpClient, s
.SetPullRequestKey(SonarPRNumber ?? Environment.GetEnvironmentVariable("CHANGE_ID"))
.SetProcessArgumentConfigurator(args =>
{
var result = args;
if (!string.IsNullOrEmpty(SonarPRProvider))
result = result.Add($"/d:sonar.pullrequest.provider={SonarPRProvider}");
{
args = args.Add($"/d:sonar.pullrequest.provider={SonarPRProvider}");
}

if (!string.IsNullOrEmpty(SonarGithubRepo))
result = result.Add("/d:sonar.pullrequest.github.repository={value}", SonarGithubRepo);
return result;
{
args = args.Add("/d:sonar.pullrequest.github.repository={value}", SonarGithubRepo);
}

return args;
}))
.When(!PullRequest, cc => cc
.SetBranchName(branchName)
.When(_sonarLongLiveBranches.Contains(branchName), ccc => ccc
.SetProcessArgumentConfigurator(args => args.Add($"/d:\"sonar.branch.target={branchNameTarget}\""))))
.SetProcessArgumentConfigurator(args =>
{
if (_sonarLongLiveBranches.Contains(branchName))
{
args = args.Add($"/d:\"sonar.branch.target={branchNameTarget}\"");
}

return args;
})
)
);
});

Expand Down

0 comments on commit dbbb53c

Please sign in to comment.