File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,22 +113,29 @@ jobs:
113113 - name : Create Release
114114 id : create_release
115115 run : |
116- gh release create "${{ steps.new_version.outputs.new_version }}" \
117- --title "Release ${{ steps.new_version.outputs.new_version }}" \
118- --notes "$(cat <<EOF
116+ NOTES_FILE="$(mktemp)"
117+
118+ cat > "$NOTES_FILE" <<' EOF'
119119 ## What's Changed
120120
121121 Auto-generated release from main branch.
122122
123123 **Commits included:**
124- \`\`\ `
125- $COMMIT_MESSAGE
126- \`\`\ `
124+ `` `
125+ __COMMITS_HERE__
126+ `` `
127127
128128 **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_bump.outputs.current_version }}...${{ steps.new_version.outputs.new_version }}
129129 EOF
130- )"
131- echo "tag_name=${{ steps.new_version.outputs.new_version }}" >> $GITHUB_OUTPUT
130+
131+ # Replace placeholder with the commit message safely (no shell expansion)
132+ perl -0777 -pe 's/__COMMITS_HERE__/\Q$ENV{COMMIT_MESSAGE}\E/g' -i "$NOTES_FILE"
133+
134+ gh release create "${{ steps.new_version.outputs.new_version }}" \
135+ --title "Release ${{ steps.new_version.outputs.new_version }}" \
136+ --notes-file "$NOTES_FILE"
137+
138+ echo "tag_name=${{ steps.new_version.outputs.new_version }}" >> "$GITHUB_OUTPUT"
132139 env :
133140 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134141 COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
You can’t perform that action at this time.
0 commit comments