Skip to content

Commit b026d34

Browse files
authored
fix how to escape
1 parent 579c1d6 commit b026d34

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/create-draft-release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ jobs:
108108
109109
- name: Prepare Release Title
110110
id: title
111+
env:
112+
# "vX.Y.Z Release Title"
113+
RAW_TITLE: ${{ steps.calculate-version.outputs.new_version }} ${{ github.event.inputs.release_title }}
111114
run: |
112-
# Escaping double quotes in the title
113-
SANITIZED_TITLE=$(echo "${{ steps.calculate-version.outputs.new_version }} ${{ github.event.inputs.release_title }}" | sed 's/"/\\"/g')
115+
# Print RAW_TITLE safely, then escape double quotes
116+
SANITIZED_TITLE="$(printf '%s' "$RAW_TITLE" | sed 's/"/\\"/g')"
114117
echo "sanitized_title=$SANITIZED_TITLE" >> "$GITHUB_OUTPUT"
115118
116119
- name: Write Release Notes to File

0 commit comments

Comments
 (0)