Skip to content

Commit

Permalink
Escape multiline string before setting output
Browse files Browse the repository at this point in the history
  • Loading branch information
heinrichreimer committed Nov 16, 2020
1 parent b5a9892 commit a1e2bd6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion entrypoint.sh
Expand Up @@ -159,5 +159,10 @@ fi

# Save change log to outputs.
if [[ -e "$FILE" ]]; then
echo ::set-output name=changelog::"$(cat "$FILE")"
CONTENT=$(cat "$FILE")
# Escape as per https://github.community/t/set-output-truncates-multiline-strings/16852/3.
CONTENT="${CONTENT//'%'/'%25'}"
CONTENT="${CONTENT//$'\n'/'%0A'}"
CONTENT="${CONTENT//$'\r'/'%0D'}"
echo ::set-output name=changelog::"$CONTENT"
fi

0 comments on commit a1e2bd6

Please sign in to comment.