Skip to content

Commit

Permalink
feat: Multiline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaironalves committed Jul 12, 2024
1 parent bcb6eba commit 8b695d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ _key_value_to_multiline() {
local keyValue="$1"
local lineMark="#LN#"

keyValueMultiLine=$(echo "$keyValue" | sed "s/\\\\n/$lineMark/g")
keyValueMultiLine=$(echo "$keyValueMultiLine" | sed 's/\\/\\\\/g')
keyValueMultiLine=$(echo "$keyValueMultiLine" | sed "s/$lineMark/\n/g")
keyValueMultiLine=$(echo "$keyValueMultiLine" | sed '${/^$/d;}')
#keyValueMultiLine=$(echo "$keyValue" | sed "s/\\\\n/$lineMark/g")
keyValueMultiLine=$(echo "$keyValue" | sed 's/\\/\\\\/g')
#keyValueMultiLine=$(echo "$keyValueMultiLine" | sed "s/$lineMark/\n/g")
#keyValueMultiLine=$(echo "$keyValueMultiLine" | sed '${/^$/d;}')
echo "$keyValueMultiLine"
}

Expand All @@ -135,7 +135,7 @@ _set_github_output() {
keyValueMultiLine=$(_key_value_to_multiline "$keyValue")
{
echo "$keyNameOutput<<EOF"
printf "%s\n" "$keyValue"
printf "%s\n" "$keyValueMultiLine"
echo "EOF"
} >>"$GITHUB_OUTPUT"
else
Expand Down

0 comments on commit 8b695d8

Please sign in to comment.