Skip to content

Commit d1e5615

Browse files
committed
Fix build.cake PushGitTag task
1 parent 71f8f05 commit d1e5615

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.cake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Setup(context =>
4141
Information("Hotfix branch: {0}", buildParameters.IsHotFixBranch);
4242
Information("Pull request: {0}", buildParameters.IsPullRequest);
4343
Information("Apply git tag: {0} | {1}", buildParameters.ShouldApplyGitTag, buildParameters.GitTagName);
44+
Information("Push git tag: {0} | {1}", buildParameters.ShouldPushGitTag, buildParameters.GitTagName);
4445
Information("Publish to myget: {0}", buildParameters.ShouldPublishMyGet);
4546
Information("Publish to nuget: {0}", buildParameters.ShouldPublishNuGet);
4647

@@ -278,10 +279,12 @@ RunTarget(target);
278279
public class BuildParameters
279280
{
280281
private ICakeContext _context;
282+
private bool _shouldApplyGitTag;
281283

282284
public BuildParameters(ICakeContext context)
283285
{
284286
_context = context;
287+
_shouldApplyGitTag = !context.GitTags("./").Any(t => t.FriendlyName == GitTagName);
285288
}
286289

287290
public GitVersion GitVersion => _context.GitVersion();
@@ -329,7 +332,8 @@ public class BuildParameters
329332
&& (IsMasterBranch || IsHotFixBranch || IsReleaseBranch)
330333
&& !IsPullRequest;
331334

332-
public bool ShouldApplyGitTag => !_context.GitTags("./").Any(t => t.FriendlyName == GitTagName);
335+
public bool ShouldApplyGitTag => _shouldApplyGitTag;
336+
333337
public bool ShouldPushGitTag => !string.IsNullOrWhiteSpace(GitHubUsername) &&
334338
!string.IsNullOrWhiteSpace(GitHubPassword) &&
335339
ShouldApplyGitTag;

0 commit comments

Comments
 (0)