Skip to content

Commit 3016172

Browse files
authored
escape backticks in create-release action so that they are handled properly (#13672)
* escape backticks in create-release action so that they are handled properly * reword comment * fix typo
1 parent fe7e1c2 commit 3016172

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/create-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
-H "Accept: application/vnd.github.v3+json" \
2828
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
2929
https://api.github.com/repos/${{ github.repository }}/commits/$COMMIT_ID/pulls)
30-
# the printf helps escape characters so that jq can parse the output.
31-
# the sed removes carriage returns so that the body is easier to parse later.
32-
PR_BODY=$(printf '%s' "$PR" | jq '.[0].body' | sed 's/\\r//g')
30+
# The printf helps escape characters so that jq can parse the output.
31+
# The sed removes carriage returns so that the body is easier to parse later, and
32+
# escapes backticks so that they are not executed as commands.
33+
PR_BODY=$(printf '%s' "$PR" | jq '.[0].body' | sed 's/\\r//g' | sed 's/`/\\`/g')
3334
echo ::set-output name=pr_body::${PR_BODY}
3435
- name: Extract Changelog
3536
id: extract_changelog

0 commit comments

Comments
 (0)