Skip to content

Commit 164ba43

Browse files
Merge pull request #11 from mmb/commit-message-quotes
Prevent quotes in commit messages from breaking json
2 parents feefbbd + f8c3c4b commit 164ba43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

assets/helpers/git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ add_pullrequest_metadata_commit() {
7272
metadata+="{name: \"($1) commit\", value: \"${commit}\"},"
7373
metadata+="{name: \"($1) author\", value: \"${author}\"},"
7474
metadata+="{name: \"($1) author_date\", value: \"${author_date}\", type: \"time\"},"
75-
metadata+="{name: \"($1) message\", value: \"${message}\", type: \"message\"}"
75+
metadata+=$(jq -n --arg name "($1) message" --arg value "$message" '{name: $name, value: $value, type: "message"}')
7676

7777
if [ "$author" != "$committer" ]; then
7878
metadata+=",{name: \"($1) committer\", value: \"${committer}\"}"

0 commit comments

Comments
 (0)