From 8d06bf5e493108b6c9b36e104654d8e4e330167f Mon Sep 17 00:00:00 2001 From: Chan Kang Date: Wed, 3 Sep 2025 21:06:40 +0900 Subject: [PATCH] fix: fix workflow --- .github/workflows/canary_release.yaml | 46 +++++++++++---------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/canary_release.yaml b/.github/workflows/canary_release.yaml index 3d61dd1..2615ad9 100644 --- a/.github/workflows/canary_release.yaml +++ b/.github/workflows/canary_release.yaml @@ -4,17 +4,17 @@ on: workflow_dispatch: inputs: new_features: - description: 'New features (leave empty if none)' + description: 'New features (use \n for line breaks, leave empty if none)' required: false type: string default: '' bug_fixes: - description: 'Bug fixes (leave empty if none)' + description: 'Bug fixes (use \n for line breaks, leave empty if none)' required: false type: string default: '' other_changes: - description: 'Other changes (leave empty if none)' + description: 'Other changes (use \n for line breaks, leave empty if none)' required: false type: string default: '' @@ -64,36 +64,28 @@ jobs: - name: Prepare release contents id: release_contents run: | - cat << 'EOF' > release_body.txt - # 🚀 New Canary Release (`${{ steps.version.outputs.version }}`) - - EOF - - # Add New Features section if provided + # Process New Features if [ -n "${{ github.event.inputs.new_features }}" ]; then - cat << 'EOF' >> release_body.txt - ## 🎉 New Features - ${{ github.event.inputs.new_features }} - - EOF + echo "## 🎉 New Features" >> release_body.txt + # Replace \n with actual line breaks and format as list items + echo "${{ github.event.inputs.new_features }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt + echo "" >> release_body.txt fi - # Add Bug Fixes section if provided + # Process Bug Fixes if [ -n "${{ github.event.inputs.bug_fixes }}" ]; then - cat << 'EOF' >> release_body.txt - ## 🐛 Bug Fixes - ${{ github.event.inputs.bug_fixes }} - - EOF + echo "## 🐛 Bug Fixes" >> release_body.txt + # Replace \n with actual line breaks and format as list items + echo "${{ github.event.inputs.bug_fixes }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt + echo "" >> release_body.txt fi - # Add Other Changes section if provided + # Process Other Changes if [ -n "${{ github.event.inputs.other_changes }}" ]; then - cat << 'EOF' >> release_body.txt - ## 🔧 Other Changes - ${{ github.event.inputs.other_changes }} - - EOF + echo "## 🔧 Other Changes" >> release_body.txt + # Replace \n with actual line breaks and format as list items + echo "${{ github.event.inputs.other_changes }}" | sed 's/\\n/\n/g' | sed 's/^[[:space:]]*-*/- /' | sed '/^[[:space:]]*$/d' >> release_body.txt + echo "" >> release_body.txt fi # Add installation and warning sections @@ -105,9 +97,9 @@ jobs: ## ⚠️ Warning This is a canary release and should not be used in production environments. - EOF + # Output the content echo "body<> $GITHUB_OUTPUT cat release_body.txt >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT