check new branch in config

This commit is contained in:
Brendan Forster
2020-06-09 18:35:52 -03:00
parent 4865d31970
commit 88f47c7773
2 changed files with 3 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ public class Context : FrostingContext
public bool IsPullRequest { get; set; }
public bool IsOriginalRepo { get; set; }
public bool IsTagged { get; set; }
public bool IsMasterBranch { get; set; }
public bool IsMainBranch { get; set; }
public bool ForcePublish { get; set; }
public bool AppVeyor { get; set; }

View File

@@ -29,13 +29,13 @@ public class Lifetime : FrostingLifetime<Context>
{
context.IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name);
context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch);
context.IsMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildSystem.AppVeyor.Environment.Repository.Branch);
}
else if (context.GitHubActions)
{
context.IsPullRequest = buildSystem.GitHubActions.Environment.PullRequest.IsPullRequest;
context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.GitHubActions.Environment.Workflow.Repository);
context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.GitHubActions.Environment.Workflow.Ref);
context.IsMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildSystem.GitHubActions.Environment.Workflow.Ref);
}
// Force publish?