Skip to content

Commit 97eb752

Browse files
committed
Escape MDX characters in the body
1 parent 3b6c776 commit 97eb752

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,15 @@ jobs:
103103
run: |
104104
echo "title=${{ needs.release.outputs.version }}" >> $GITHUB_OUTPUT
105105
body=$(gh release view ${{ needs.release.outputs.version }} --json body --jq .body)
106+
body_escaped=$(echo "$body" \
107+
| sed 's/&/\&/g' \
108+
| sed 's/</\&#60;/g' \
109+
| sed 's/>/\&#62;/g' \
110+
| sed 's/{/\&#123;/g' \
111+
| sed 's/}/\&#125;/g')
106112
{
107113
echo "body<<EOF"
108-
echo "$body"
114+
echo "$body_escaped"
109115
echo "EOF"
110116
} >> $GITHUB_OUTPUT
111117
env:

0 commit comments

Comments
 (0)