Skip to content

Commit 77b539d

Browse files
committed
Fix SonarQube analysis
1 parent 3a366b9 commit 77b539d

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

build/Build.cs

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,35 @@ protected override void OnBuildInitialized()
168168
.Before(Compile)
169169
.Executes(() =>
170170
{
171-
SonarScannerBegin(s => s
172-
.SetServer("https://sonarcloud.io")
173-
.SetFramework("net5.0")
174-
.SetLogin(SonarQubeApiKey)
175-
.SetProjectKey("resharper-structured-logging")
176-
.SetName("ReSharper Structured Logging")
177-
.SetOrganization("olsh-github")
178-
.SetVersion("1.0.0.0"));
171+
SonarScannerBegin(s =>
172+
{
173+
s = s
174+
.SetServer("https://sonarcloud.io")
175+
.SetFramework("net5.0")
176+
.SetLogin(SonarQubeApiKey)
177+
.SetProjectKey("resharper-structured-logging")
178+
.SetName("ReSharper Structured Logging")
179+
.SetOrganization("olsh")
180+
.SetVersion("1.0.0.0");
181+
182+
if (AppVeyor != null)
183+
{
184+
if (AppVeyor.PullRequestNumber != null)
185+
{
186+
s = s
187+
.SetPullRequestKey(AppVeyor.PullRequestNumber.ToString())
188+
.SetPullRequestBase(AppVeyor.RepositoryBranch)
189+
.SetPullRequestBranch(AppVeyor.PullRequestHeadRepositoryBranch);
190+
}
191+
else
192+
{
193+
s = s
194+
.SetBranchName(AppVeyor.RepositoryBranch);
195+
}
196+
}
197+
198+
return s;
199+
});
179200
});
180201

181202
Target Sonar => _ => _

build/_build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="7.0.2" />
14+
<PackageReference Include="Nuke.Common" Version="7.0.4" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

0 commit comments

Comments
 (0)