File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/run/run_environment/github_actions Expand file tree Collapse file tree 1 file changed +6
-4
lines changed 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 // TODO: make the announcement title configurable
6163 println ! ( "::notice title=New CodSpeed Feature::{escaped_announcement}" ) ;
@@ -77,10 +79,10 @@ impl Log for GithubActionLogger {
7779 Level :: Debug => "::debug::" ,
7880 Level :: Trace => "::debug::[TRACE]" ,
7981 } ;
80- let message_string = message . to_string ( ) ;
81- let lines = message_string . lines ( ) ;
82- // ensure that all the lines of the message have the prefix, otherwise GitHub Actions will not recognize the command for the whole string
83- lines . for_each ( |line| println ! ( "{prefix}{line}" ) ) ;
82+ // properly escape newlines so that GitHub Actions interprets them correctly
83+ // https://github.com/actions/toolkit/issues/193#issuecomment-605394935
84+ let message_string = message. to_string ( ) . replace ( '\n' , "%0A" ) ;
85+ println ! ( "{prefix}{message_string}" ) ;
8486 }
8587
8688 fn flush ( & self ) {
You can’t perform that action at this time.
0 commit comments