@@ -22,34 +22,40 @@ internal class DependabotProxy
22
22
/// </summary>
23
23
internal bool IsConfigured => ! string . IsNullOrEmpty ( this . Address ) ;
24
24
25
- internal DependabotProxy ( TemporaryDirectory tempWorkingDirectory )
25
+ internal DependabotProxy ( ILogger logger , TemporaryDirectory tempWorkingDirectory )
26
26
{
27
27
// Obtain and store the address of the Dependabot proxy, if available.
28
28
this . host = Environment . GetEnvironmentVariable ( EnvironmentVariableNames . ProxyHost ) ;
29
29
this . port = Environment . GetEnvironmentVariable ( EnvironmentVariableNames . ProxyPort ) ;
30
30
31
31
if ( string . IsNullOrWhiteSpace ( host ) || string . IsNullOrWhiteSpace ( port ) )
32
32
{
33
+ logger . LogInfo ( "No Dependabot proxy credentials are configured." ) ;
33
34
return ;
34
35
}
35
36
36
37
this . Address = $ "http://{ this . host } :{ this . port } ";
38
+ logger . LogInfo ( $ "Dependabot proxy configured at { this . Address } ") ;
37
39
38
40
// Obtain and store the proxy's certificate, if available.
39
41
var cert = Environment . GetEnvironmentVariable ( EnvironmentVariableNames . ProxyCertificate ) ;
40
42
41
43
if ( string . IsNullOrWhiteSpace ( cert ) )
42
44
{
45
+ logger . LogInfo ( "No certificate configured for Dependabot proxy." ) ;
43
46
return ;
44
47
}
45
48
46
49
var certDirPath = new DirectoryInfo ( Path . Join ( tempWorkingDirectory . DirInfo . FullName , ".dependabot-proxy" ) ) ;
47
50
Directory . CreateDirectory ( certDirPath . FullName ) ;
48
51
49
- this . certFile = new FileInfo ( Path . Join ( certDirPath . FullName , "proxy.crt" ) ) ;
52
+ var certFilePath = Path . Join ( certDirPath . FullName , "proxy.crt" ) ;
53
+ this . certFile = new FileInfo ( certFilePath ) ;
50
54
51
55
using var writer = this . certFile . CreateText ( ) ;
52
56
writer . Write ( cert ) ;
57
+
58
+ logger . LogInfo ( $ "Stored Dependabot proxy certificate at { certFilePath } ") ;
53
59
}
54
60
55
61
internal void ApplyProxy ( ILogger logger , ProcessStartInfo startInfo )
0 commit comments