Skip to content

Commit cf878ac

Browse files
committed
Escape specials characters in release notes
1 parent 1be0a58 commit cf878ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/dist.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ jobs:
135135
\"tag_name\": \"${{ github.ref_name }}\",
136136
\"previous_tag_name\": \"$latest_release_tag\"
137137
}" | jq -r '.body')
138+
# escape special characters for json
139+
release_notes=$(jq -R -s '.' <<< "$release_notes")
138140
curl -L \
139141
-X POST \
140142
-H "Accept: application/vnd.github+json" \
@@ -144,7 +146,7 @@ jobs:
144146
-d "{
145147
\"tag_name\": \"${{ github.ref_name }}\",
146148
\"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }},
147-
\"body\": \"$release_notes\"
149+
\"body\": $release_notes
148150
}"
149151
- name: Create release assets
150152
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)