|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | new_features: |
7 | | - description: 'New features (leave empty if none)' |
| 7 | + description: 'New features (use \n for line breaks, leave empty if none)' |
8 | 8 | required: false |
9 | 9 | type: string |
10 | 10 | default: '' |
11 | 11 | bug_fixes: |
12 | | - description: 'Bug fixes (leave empty if none)' |
| 12 | + description: 'Bug fixes (use \n for line breaks, leave empty if none)' |
13 | 13 | required: false |
14 | 14 | type: string |
15 | 15 | default: '' |
16 | 16 | other_changes: |
17 | | - description: 'Other changes (leave empty if none)' |
| 17 | + description: 'Other changes (use \n for line breaks, leave empty if none)' |
18 | 18 | required: false |
19 | 19 | type: string |
20 | 20 | default: '' |
@@ -64,36 +64,28 @@ jobs: |
64 | 64 | - name: Prepare release contents |
65 | 65 | id: release_contents |
66 | 66 | run: | |
67 | | - cat << 'EOF' > release_body.txt |
68 | | - # 🚀 New Canary Release (`${{ steps.version.outputs.version }}`) |
69 | | - |
70 | | - EOF |
71 | | - |
72 | | - # Add New Features section if provided |
| 67 | + # Process New Features |
73 | 68 | if [ -n "${{ github.event.inputs.new_features }}" ]; then |
74 | | - cat << 'EOF' >> release_body.txt |
75 | | - ## 🎉 New Features |
76 | | - ${{ github.event.inputs.new_features }} |
77 | | - |
78 | | - EOF |
| 69 | + echo "## 🎉 New Features" >> release_body.txt |
| 70 | + # Replace \n with actual line breaks and format as list items |
| 71 | + echo "${{ github.event.inputs.new_features }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt |
| 72 | + echo "" >> release_body.txt |
79 | 73 | fi |
80 | 74 | |
81 | | - # Add Bug Fixes section if provided |
| 75 | + # Process Bug Fixes |
82 | 76 | if [ -n "${{ github.event.inputs.bug_fixes }}" ]; then |
83 | | - cat << 'EOF' >> release_body.txt |
84 | | - ## 🐛 Bug Fixes |
85 | | - ${{ github.event.inputs.bug_fixes }} |
86 | | - |
87 | | - EOF |
| 77 | + echo "## 🐛 Bug Fixes" >> release_body.txt |
| 78 | + # Replace \n with actual line breaks and format as list items |
| 79 | + echo "${{ github.event.inputs.bug_fixes }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt |
| 80 | + echo "" >> release_body.txt |
88 | 81 | fi |
89 | 82 | |
90 | | - # Add Other Changes section if provided |
| 83 | + # Process Other Changes |
91 | 84 | if [ -n "${{ github.event.inputs.other_changes }}" ]; then |
92 | | - cat << 'EOF' >> release_body.txt |
93 | | - ## 🔧 Other Changes |
94 | | - ${{ github.event.inputs.other_changes }} |
95 | | - |
96 | | - EOF |
| 85 | + echo "## 🔧 Other Changes" >> release_body.txt |
| 86 | + # Replace \n with actual line breaks and format as list items |
| 87 | + echo "${{ github.event.inputs.other_changes }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt |
| 88 | + echo "" >> release_body.txt |
97 | 89 | fi |
98 | 90 | |
99 | 91 | # Add installation and warning sections |
|
105 | 97 | |
106 | 98 | ## ⚠️ Warning |
107 | 99 | This is a canary release and should not be used in production environments. |
108 | | - |
109 | 100 | EOF |
110 | 101 | |
| 102 | + # Output the content |
111 | 103 | echo "body<<EOF" >> $GITHUB_OUTPUT |
112 | 104 | cat release_body.txt >> $GITHUB_OUTPUT |
113 | 105 | echo "EOF" >> $GITHUB_OUTPUT |
|
0 commit comments