Skip to content

Commit fb860a3

Browse files
authored
Update main.yml
1 parent bd9156d commit fb860a3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ jobs:
8080

8181
############# Release with workflow_dispatch #############
8282

83-
- name: Read Changelog
84-
id: changelog
83+
- name: Read and Escape Changelog
8584
run: |
86-
echo "CHANGELOG=$(cat changelog_new.txt)" >> $GITHUB_ENV
85+
# Check if the changelog file exists
86+
if [ -f changelog_new.txt ]; then
87+
# Read the file and escape necessary characters
88+
ESCAPED_CHANGELOG=$(cat changelog_new.txt | sed 's/"/\\"/g' | sed "s/'/\\'/g" | awk '{printf "%s\\n", $0}')
89+
echo "ESCAPED_CHANGELOG=$ESCAPED_CHANGELOG" >> $GITHUB_ENV
8790
8891
- name: Zip Linux Build for Release
8992
if: github.event_name == 'workflow_dispatch'
@@ -106,7 +109,7 @@ jobs:
106109
with:
107110
tag_name: ${{ steps.version_info.outputs.FULL_VERSION }}
108111
release_name: ${{ steps.version_info.outputs.FULL_VERSION }}
109-
body: ${{ env.CHANGELOG }}
112+
body: ${{ env.ESCAPED_CHANGELOG }}
110113
draft: false
111114
prerelease: false
112115

0 commit comments

Comments
 (0)