Skip to content

Commit 3462307

Browse files
authored
Update create-draft-release.yml
1 parent 058b774 commit 3462307

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,24 @@ jobs:
106106
console.log(`releaseNotes (modified): ${JSON.stringify(modifiedBody, null, 2)}`);
107107
core.setOutput("release_body", modifiedBody);
108108
109-
- name: Write release notes to file
109+
- name: Prepare Release Title
110+
id: title
111+
env:
112+
# "vX.Y.Z Release Title"
113+
RAW_TITLE: ${{ steps.calculate-version.outputs.new_version }} ${{ github.event.inputs.release_title }}
114+
run: |
115+
# Print RAW_TITLE safely, then escape double quotes
116+
SANITIZED_TITLE="$(printf '%s' "$RAW_TITLE" | sed 's/"/\\"/g')"
117+
echo "sanitized_title=$SANITIZED_TITLE" >> "$GITHUB_OUTPUT"
118+
119+
- name: Write Release Notes to File
110120
run: |
111121
echo "${{ steps.generate-release-notes.outputs.release_body }}" > release-notes.txt
122+
112123
- name: Create Draft Release
113124
run: |
114125
gh release create "${{ steps.calculate-version.outputs.new_version }}" \
115-
--title "${{ steps.calculate-version.outputs.new_version }} ${{ github.event.inputs.release_title }}" \
126+
--title "${{ steps.title.outputs.sanitized_title }}" \
116127
--notes-file release-notes.txt \
117128
--draft \
118129
--repo "${{ github.repository }}"

0 commit comments

Comments
 (0)