Skip to content

Commit 8d06bf5

Browse files
committed
fix: fix workflow
1 parent c5987a6 commit 8d06bf5

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

.github/workflows/canary_release.yaml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ on:
44
workflow_dispatch:
55
inputs:
66
new_features:
7-
description: 'New features (leave empty if none)'
7+
description: 'New features (use \n for line breaks, leave empty if none)'
88
required: false
99
type: string
1010
default: ''
1111
bug_fixes:
12-
description: 'Bug fixes (leave empty if none)'
12+
description: 'Bug fixes (use \n for line breaks, leave empty if none)'
1313
required: false
1414
type: string
1515
default: ''
1616
other_changes:
17-
description: 'Other changes (leave empty if none)'
17+
description: 'Other changes (use \n for line breaks, leave empty if none)'
1818
required: false
1919
type: string
2020
default: ''
@@ -64,36 +64,28 @@ jobs:
6464
- name: Prepare release contents
6565
id: release_contents
6666
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
7368
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
7973
fi
8074
81-
# Add Bug Fixes section if provided
75+
# Process Bug Fixes
8276
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
8881
fi
8982
90-
# Add Other Changes section if provided
83+
# Process Other Changes
9184
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
9789
fi
9890
9991
# Add installation and warning sections
@@ -105,9 +97,9 @@ jobs:
10597
10698
## ⚠️ Warning
10799
This is a canary release and should not be used in production environments.
108-
109100
EOF
110101
102+
# Output the content
111103
echo "body<<EOF" >> $GITHUB_OUTPUT
112104
cat release_body.txt >> $GITHUB_OUTPUT
113105
echo "EOF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)