File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1+ using Microsoft . Extensions . Http . Logging ;
12using Microsoft . Extensions . Options ;
23using ModularPipelines . GitHub . Options ;
4+ using ModularPipelines . Http ;
35using ModularPipelines . Logging ;
46using Octokit ;
57using Octokit . Internal ;
@@ -60,8 +62,27 @@ private IGitHubClient InitializeClient()
6062 ?? EnvironmentVariables . Token
6163 ?? throw new ArgumentException ( "No GitHub access token or GITHUB_TOKEN found in environment variables." ) ;
6264
63- var client = new GitHubClient ( new ProductHeaderValue ( "ModularPipelines" ) ,
64- new InMemoryCredentialStore ( new Credentials ( token ) ) ) ;
65+ var connection = new Connection ( new ProductHeaderValue ( "ModularPipelines" ) ,
66+ new HttpClientAdapter ( ( ) =>
67+ {
68+ var moduleLogger = _moduleLoggerProvider . GetLogger ( ) ;
69+
70+ return new RequestLoggingHttpHandler ( moduleLogger )
71+ {
72+ InnerHandler = new ResponseLoggingHttpHandler ( moduleLogger )
73+ {
74+ InnerHandler = new StatusCodeLoggingHttpHandler ( moduleLogger )
75+ {
76+ InnerHandler = new HttpClientHandler ( ) ,
77+ } ,
78+ } ,
79+ } ;
80+ } ) ) ;
81+
82+ var client = new GitHubClient ( connection )
83+ {
84+ Credentials = new Credentials ( token ) ,
85+ } ;
6586
6687 return client ;
6788 }
Original file line number Diff line number Diff line change 66 <Description >Write your pipelines in C#!</Description >
77 </PropertyGroup >
88 <ItemGroup >
9+ <AssemblyAttribute Include =" System.Runtime.CompilerServices.InternalsVisibleToAttribute" >
10+ <_Parameter1 >ModularPipelines.GitHub</_Parameter1 >
11+ </AssemblyAttribute >
912 <AssemblyAttribute Include =" System.Runtime.CompilerServices.InternalsVisibleToAttribute" >
1013 <_Parameter1 >ModularPipelines.UnitTests</_Parameter1 >
1114 </AssemblyAttribute >
You can’t perform that action at this time.
0 commit comments