1919using Nuke . Common . Tools . DotNet ;
2020using Nuke . Common . Utilities ;
2121using Octokit ;
22+ using Serilog ;
2223using static Nuke . Common . IO . FileSystemTasks ;
2324using static Nuke . Common . Tooling . ProcessTasks ;
2425using static Nuke . Common . Tools . DotNet . DotNetTasks ;
@@ -147,27 +148,27 @@ async Task AddOrUpdatePrComment(string type, string file, bool editOnly = false,
147148 var githubToken = EnvironmentInfo . GetVariable < string > ( "GITHUB_TOKEN" ) ;
148149 if ( string . IsNullOrWhiteSpace ( githubToken ) )
149150 {
150- Logger . Info ( "GitHub token not found, skipping writing a comment." ) ;
151+ Log . Information ( "GitHub token not found, skipping writing a comment." ) ;
151152 return ;
152153 }
153154
154155 var @ref = GitHubActions . Instance ? . Ref ;
155156 if ( string . IsNullOrWhiteSpace ( @ref ) )
156157 {
157- Logger . Info ( "Not running in GitHub Actions, skipping writing a comment." ) ;
158+ Log . Information ( "Not running in GitHub Actions, skipping writing a comment." ) ;
158159 return ;
159160 }
160161
161162 var prMatch = PrRegex . Match ( @ref ) ;
162163 if ( ! prMatch . Success || prMatch . Groups . Count < 2 )
163164 {
164- Logger . Info ( $ "Couldn't match { @ref } to a PR, skipping writing a comment.") ;
165+ Log . Information ( $ "Couldn't match { @ref } to a PR, skipping writing a comment.") ;
165166 return ;
166167 }
167168
168169 if ( ! int . TryParse ( prMatch . Groups [ 1 ] . Value , out var pr ) )
169170 {
170- Logger . Info ( $ "Couldn't parse { @prMatch . Groups [ 1 ] . Value } as an int, skipping writing a comment.") ;
171+ Log . Information ( $ "Couldn't parse { @prMatch . Groups [ 1 ] . Value } as an int, skipping writing a comment.") ;
171172 return ;
172173 }
173174
@@ -181,7 +182,7 @@ async Task AddOrUpdatePrComment(string type, string file, bool editOnly = false,
181182 . FirstOrDefault ( x => x . Body . Contains ( $ "`{ type } `") && x . User . Name == "github-actions[bot]" ) ;
182183 if ( existingComment is null && editOnly )
183184 {
184- Logger . Info ( "Edit only mode is on and no existing comment found, skipping writing a comment." ) ;
185+ Log . Information ( "Edit only mode is on and no existing comment found, skipping writing a comment." ) ;
185186 return ;
186187 }
187188
@@ -198,12 +199,12 @@ async Task AddOrUpdatePrComment(string type, string file, bool editOnly = false,
198199
199200 if ( existingComment is not null )
200201 {
201- Logger . Info ( "Updated the comment on the PR." ) ;
202+ Log . Information ( "Updated the comment on the PR." ) ;
202203 await github . Issue . Comment . Update ( "dotnet" , "Silk.NET" , existingComment . Id , commentText ) ;
203204 }
204205 else
205206 {
206- Logger . Info ( "Added a comment to the PR." ) ;
207+ Log . Information ( "Added a comment to the PR." ) ;
207208 await github . Issue . Comment . Create ( "dotnet" , "Silk.NET" , pr , commentText ) ;
208209 }
209210 }
0 commit comments