本文整理汇总了C#中Microsoft.DotNet.Cli.Build.Framework.BuildTargetContext.GetRemoteBranchName方法的典型用法代码示例。如果您正苦于以下问题:C# BuildTargetContext.GetRemoteBranchName方法的具体用法?C# BuildTargetContext.GetRemoteBranchName怎么用?C# BuildTargetContext.GetRemoteBranchName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.DotNet.Cli.Build.Framework.BuildTargetContext
的用法示例。
在下文中一共展示了BuildTargetContext.GetRemoteBranchName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePR
public static BuildTargetResult CreatePR(BuildTargetContext c)
{
string remoteBranchName = c.GetRemoteBranchName();
NewPullRequest prInfo = new NewPullRequest(
PullRequestTitle,
s_config.GitHubOriginOwner + ":" + remoteBranchName,
s_config.GitHubUpstreamBranch);
GitHubClient gitHub = new GitHubClient(new ProductHeaderValue("dotnetDependencyUpdater"));
gitHub.Credentials = new Credentials(s_config.Password);
PullRequest createdPR = gitHub.PullRequest.Create(s_config.GitHubUpstreamOwner, s_config.GitHubProject, prInfo).Result;
c.Info($"Created Pull Request: {createdPR.HtmlUrl}");
return c.Success();
}
示例2: CreatePR
public static BuildTargetResult CreatePR(BuildTargetContext c)
{
string remoteBranchName = c.GetRemoteBranchName();
string commitMessage = c.GetCommitMessage();
NewPullRequest prInfo = new NewPullRequest(
commitMessage,
s_config.GitHubOriginOwner + ":" + remoteBranchName,
s_config.GitHubUpstreamBranch);
string[] prNotifications = s_config.GitHubPullRequestNotifications;
if (prNotifications.Length > 0)
{
prInfo.Body = $"/cc @{string.Join(" @", prNotifications)}";
}
GitHubClient gitHub = new GitHubClient(new ProductHeaderValue("dotnetDependencyUpdater"));
gitHub.Credentials = new Credentials(s_config.Password);
PullRequest createdPR = gitHub.PullRequest.Create(s_config.GitHubUpstreamOwner, s_config.GitHubProject, prInfo).Result;
c.Info($"Created Pull Request: {createdPR.HtmlUrl}");
return c.Success();
}