Esempio n. 1
0
        /// <inheritdoc/>
        public async Task <bool> CreatePullRequest(string org, string repository, CreatePullRequestOption createPullRequestOption)
        {
            string content = JsonSerializer.Serialize(createPullRequestOption);
            HttpResponseMessage response = await _httpClient.PostAsync($"repos/{org}/{repository}/pulls", new StringContent(content, Encoding.UTF8, "application/json"));

            return(response.IsSuccessStatusCode);
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public async Task <bool> CreatePullRequest(string org, string repository, string target, string source, string title)
        {
            CreatePullRequestOption option = new CreatePullRequestOption
            {
                Base  = target,
                Head  = source,
                Title = title
            };

            return(await _gitea.CreatePullRequest(org, repository, option));
        }
Esempio n. 3
0
        /// <summary>
        /// /POST /repos/{owner}/{repo}/pulls Create a pull request
        /// </summary>
        /// <param name="owner">owner of the repo</param>
        /// <param name="repositoryName">name of the repository</param>
        /// <param name="pullRequest">pull request information</param>
        /// <returns></returns>
        public async Task <PullRequest> OpenPullRequest(string owner, string repositoryName, CreatePullRequestOption pullRequest)
        {
            var encodedProjectName = $"{owner}/{repositoryName}";

            var content = new StringContent(JsonConvert.SerializeObject(pullRequest), Encoding.UTF8,
                                            "application/json");

            return(await PostResource <PullRequest>($"repos/{encodedProjectName}/pulls", content));
        }
Esempio n. 4
0
 public async Task <bool> CreatePullRequest(string org, string app, CreatePullRequestOption createPullRequestOption)
 {
     return(await Task.FromResult(true));
 }