From 59c9b1898da9c9b9d12d69b46cdcf393214514ce Mon Sep 17 00:00:00 2001 From: lmossman Date: Thu, 9 Jun 2022 19:56:21 -0700 Subject: [PATCH 1/3] escape backticks in create-release action so that they are handled properly --- .github/workflows/create-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index dfc267a57834..3c348d7b029f 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -28,8 +28,8 @@ jobs: -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 sed removes carriage returns and escapes backticks so that the body is easier to parse later. + 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 From 3aecb6a9e61475ce9a9ff6d6433eb340b9140f38 Mon Sep 17 00:00:00 2001 From: lmossman Date: Thu, 9 Jun 2022 19:59:04 -0700 Subject: [PATCH 2/3] reword comment --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 3c348d7b029f..2e033a040598 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -28,7 +28,7 @@ jobs: -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 and escapes backticks so that the body is easier to parse later. + # the sed removes carriage returns 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 From caf9a08e484a33f7df02f45dd2f2fefe69650583 Mon Sep 17 00:00:00 2001 From: lmossman Date: Thu, 9 Jun 2022 20:00:14 -0700 Subject: [PATCH 3/3] fix typo --- .github/workflows/create-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 2e033a040598..2cb8dfea3d49 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -27,8 +27,9 @@ 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 that the body is easier to parse later, and escapes backticks so that they are not executed as commands. + # 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