private async Task SubmitPullRequestAsync(string title, string remoteBranchName) { string description = "Automated update based on dotnet/versions repository."; if (_notifyGitHubUsers != null) { description += $"\n\n/cc @{string.Join(" @", _notifyGitHubUsers)}"; } using (GitHubHttpClient client = new GitHubHttpClient(_gitHubAuth)) { await client.PostGitHubPullRequestAsync( title, description, originOwner: _gitHubAuth.User, originBranch: remoteBranchName, upstreamOwner: _projectRepoOwner, upstreamBranch: _projectRepoBranch, project: _projectRepo); } }
private async Task UpdateGitHubFileAsync(string path, string newFileContent, string commitMessage) { using (GitHubHttpClient client = new GitHubHttpClient(_gitHubAuth)) { string fileUrl = $"https://api.github.com/repos/{_versionsRepoOwner}/{_versionsRepo}/contents/{path}"; await client.PutGitHubFileAsync(fileUrl, commitMessage, newFileContent); } }