Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escape backticks in create-release action so that they are handled properly #13672

Merged
merged 3 commits into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down