Fix the escaping of commit message in the stackbrew pr script

Switch to using sed as a safer approach
This commit is contained in:
Laurent Goderre 2018-05-09 10:04:19 -04:00
parent 2ecc9e8579
commit bfc5832ca6
1 changed files with 1 additions and 2 deletions

View File

@ -84,8 +84,7 @@ function message() {
function pr_payload() {
local escaped_message
IFS=' ' read -ra escaped_message <<< "$COMMIT_MESSAGE"
escaped_message="$(printf '%q ' "${escaped_message[@]}")"
escaped_message="$(echo "$COMMIT_MESSAGE" | sed -E -e "s/\"/\\\\\"/g")"
echo '{
"title": "Node: '"$escaped_message"'",
"body": "Commit: nodejs/docker-node@'"$COMMIT_ID"'",