File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
cpp-linter-lib/src/rest_api Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -128,15 +128,16 @@ impl RestApiClient for GithubApiClient {
128128 . append ( true )
129129 . open ( gh_out)
130130 . expect ( "GITHUB_OUTPUT file could not be opened" ) ;
131- if let Err ( e ) = writeln ! (
132- gh_out_file ,
133- "checks-failed={} \n format- checks-failed={} \n tidy-checks-failed={}" ,
134- checks_failed ,
135- format_checks_failed . unwrap_or ( 0 ) ,
136- tidy_checks_failed . unwrap_or( 0 ) ,
137- ) {
138- log :: error! ( "Could not write to GITHUB_OUTPUT file: {}" , e ) ;
131+ for ( prompt , value ) in [
132+ ( "checks-failed" , Some ( checks_failed ) ) ,
133+ ( "format- checks-failed" , format_checks_failed ) ,
134+ ( "tidy-checks-failed" , tidy_checks_failed ) ,
135+ ] {
136+ if let Err ( e ) = writeln ! ( gh_out_file , "{prompt}={}" , value . unwrap_or( 0 ) , ) {
137+ log :: error! ( "Could not write to GITHUB_OUTPUT file: {}" , e ) ;
138+ }
139139 }
140+ gh_out_file. flush ( ) . expect ( "Failed to flush buffer to GITHUB_OUTPUT file" ) ;
140141 }
141142 log:: info!(
142143 "{} clang-format-checks-failed" ,
You can’t perform that action at this time.
0 commit comments