File tree Expand file tree Collapse file tree
src/run/run_environment/github_actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ impl Log for GithubActionLogger {
5656 }
5757
5858 if let Some ( announcement) = get_announcement_event ( record) {
59+ // properly escape newlines so that GitHub Actions interprets them correctly
60+ // https://github.com/actions/toolkit/issues/193#issuecomment-605394935
5961 let escaped_announcement = announcement. replace ( '\n' , "%0A" ) ;
6062 println ! ( "::notice title=New CodSpeed Feature::{escaped_announcement}" ) ;
6163 return ;
@@ -76,10 +78,10 @@ impl Log for GithubActionLogger {
7678 Level :: Debug => "::debug::" ,
7779 Level :: Trace => "::debug::[TRACE]" ,
7880 } ;
79- let message_string = message . to_string ( ) ;
80- let lines = message_string . lines ( ) ;
81- // ensure that all the lines of the message have the prefix, otherwise GitHub Actions will not recognize the command for the whole string
82- lines . for_each ( |line| println ! ( "{prefix}{line}" ) ) ;
81+ // properly escape newlines so that GitHub Actions interprets them correctly
82+ // https://github.com/actions/toolkit/issues/193#issuecomment-605394935
83+ let message_string = message. to_string ( ) . replace ( '\n' , "%0A" ) ;
84+ println ! ( "{prefix}{message_string}" ) ;
8385 }
8486
8587 fn flush ( & self ) {
You can’t perform that action at this time.
0 commit comments