public MyGithubApi(MyGithubConfig config) { var client = new GitHubClient(new ProductHeaderValue(config.Username)); if (!string.IsNullOrWhiteSpace(config.PersonalAccessToken)) { client.Credentials = new Credentials(config.PersonalAccessToken); //var basicAuth = new Credentials("ps201908", "DDkk1212"); //client.Credentials = basicAuth; } Client = client; }
//helpers public static MyGithubApi Create(MyGithubConfig config) { //https://laedit.net/2016/11/12/GitHub-commit-with-Octokit-net.html return(new MyGithubApi(config)); }