Closed
Description
This came up in the forum: https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/m-p/52511/highlight/true#M8539
with a suggestion to post an issue here.
the enhancement
Please add an example to the docs, probably in https://github.com/actions/toolkit/blob/master/docs/commands.md, on how to best allow for multi-line value in set-env or set-output.
Code Snippet
The suggested solution in the forum is to manually escape newlines in the shell script with
REPORT="${REPORT//'%'/'%25'}"
REPORT="${REPORT//$'\n'/'%0A'}"
REPORT="${REPORT//$'\r'/'%0D'}"
potential bug
https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L76
already should escape, so perhaps something else is not working.
#193 seems related.