From 30161726c27733ea1401af56634b550622acfbfe Mon Sep 17 00:00:00 2001 From: Lake Mossman Date: Fri, 10 Jun 2022 08:59:22 -0700 Subject: [PATCH] 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 --- .github/workflows/create-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index dfc267a57834b..2cb8dfea3d494 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -27,9 +27,10 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/commits/$COMMIT_ID/pulls) - # the printf helps escape characters so that jq can parse the output. - # the sed removes carriage returns so that the body is easier to parse later. - PR_BODY=$(printf '%s' "$PR" | jq '.[0].body' | sed 's/\\r//g') + # The printf helps escape characters so that jq can parse the output. + # The sed removes carriage returns so that the body is easier to parse later, and + # escapes backticks so that they are not executed as commands. + PR_BODY=$(printf '%s' "$PR" | jq '.[0].body' | sed 's/\\r//g' | sed 's/`/\\`/g') echo ::set-output name=pr_body::${PR_BODY} - name: Extract Changelog id: extract_changelog