Skip to content

Commit c82ee3e

Browse files
committed
Update build script to not publish pull requests to nuget
1 parent 99eb9ff commit c82ee3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build.cake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var configuration = Argument<string>("configuration", "Release");
1717

1818
var solutions = GetFiles("./**/*.sln");
1919
var projects = GetFiles("./**/*.csproj").Select(x => x.GetDirectory());
20-
string buildArtifactsDirectory = "./BuildArtifacts";
20+
var buildArtifactsDirectory = "./BuildArtifacts";
2121

2222
GitVersion gitVersion;
2323

@@ -292,6 +292,8 @@ public class BuildParameters
292292

293293
public bool IsLocalBuild => _context.BuildSystem().IsLocalBuild;
294294

295+
public bool IsPullRequest => _context.BuildSystem().AppVeyor.Environment.PullRequest.IsPullRequest;
296+
295297
public string BranchName
296298
{
297299
get
@@ -322,5 +324,6 @@ public class BuildParameters
322324

323325
public bool ShouldPublishNuGet => !string.IsNullOrWhiteSpace(NuGetApiKey)
324326
&& !string.IsNullOrWhiteSpace(NuGetFeed)
325-
&& (IsMasterBranch || IsHotFixBranch);
327+
&& (IsMasterBranch || IsHotFixBranch)
328+
&& !IsPullRequest;
326329
}

0 commit comments

Comments
 (0)