示例#1
0
 private async Task <IGitHubClient> GetGitHubClientAsync(string org, string repo)
 {
     return(new GitHubClient(_githubClientOptions.Value.ProductHeader)
     {
         Credentials = new Credentials(await _tokenProvider.GetTokenForRepository(org, repo))
     });
 }
示例#2
0
 public static Task <string> GetTokenForRepository(this IGitHubTokenProvider provider, string organization, string repository)
 {
     return(provider.GetTokenForRepository(GitHubHelper.GetRepositoryUrl(organization, repository)));
 }
 public async Task <IGitHubClient> CreateGitHubClientAsync(string owner, string repo)
 {
     return(_clientFactory.CreateGitHubClient(await _tokenProvider.GetTokenForRepository(owner, repo)));
 }