示例#1
0
        /// <summary>
        /// 创建PR请求
        /// </summary>
        /// <returns></returns>
        public async Task <PullRequest> PullRequest(NewPullRequestModel pr)
        {
            if (SetToken())
            {
                var result = await _client.PullRequest.Create(pr.Owner, pr.Name, new NewPullRequest(pr.Title, pr.Head, pr.Base));

                return(result);
            }
            return(null);
        }
示例#2
0
 /// <summary>
 /// 是否有待处理的PR
 /// </summary>
 /// <param name="pr"></param>
 /// <returns></returns>
 public bool HasPR(NewPullRequestModel pr, out PullRequest pullRequet)
 {
     if (SetToken())
     {
         var response = _client.PullRequest.GetAllForRepository(pr.Owner, pr.Name, new PullRequestRequest
         {
             Base = pr.Base,
             Head = pr.Head
         }).Result;
         if (response.Count > 0)
         {
             pullRequet = response.FirstOrDefault();
             return(true);
         }
     }
     pullRequet = null;
     return(false);
 }