File tree 2 files changed +26
-2
lines changed 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ using Microsoft . Extensions . Http . Logging ;
1
2
using Microsoft . Extensions . Options ;
2
3
using ModularPipelines . GitHub . Options ;
4
+ using ModularPipelines . Http ;
3
5
using ModularPipelines . Logging ;
4
6
using Octokit ;
5
7
using Octokit . Internal ;
@@ -60,8 +62,27 @@ private IGitHubClient InitializeClient()
60
62
?? EnvironmentVariables . Token
61
63
?? throw new ArgumentException ( "No GitHub access token or GITHUB_TOKEN found in environment variables." ) ;
62
64
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
+ } ;
65
86
66
87
return client ;
67
88
}
Original file line number Diff line number Diff line change 6
6
<Description >Write your pipelines in C#!</Description >
7
7
</PropertyGroup >
8
8
<ItemGroup >
9
+ <AssemblyAttribute Include =" System.Runtime.CompilerServices.InternalsVisibleToAttribute" >
10
+ <_Parameter1 >ModularPipelines.GitHub</_Parameter1 >
11
+ </AssemblyAttribute >
9
12
<AssemblyAttribute Include =" System.Runtime.CompilerServices.InternalsVisibleToAttribute" >
10
13
<_Parameter1 >ModularPipelines.UnitTests</_Parameter1 >
11
14
</AssemblyAttribute >
You can’t perform that action at this time.
0 commit comments