Skip to content

Commit 3037d6a

Browse files
authored
fix: simplify release workflow to avoid multi-line output issues (#1789)
1 parent 6365fa4 commit 3037d6a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,29 @@ jobs:
6969
tail -n +$START_LINE CHANGELOG.md > version-changelog.md
7070
fi
7171
72-
# Use a unique delimiter that won't appear in changelog content
73-
delimiter="END_OF_RELEASE_NOTES_$(date +%s)"
74-
echo "RELEASE_NOTES<<$delimiter" >> $GITHUB_OUTPUT
75-
cat version-changelog.md >> $GITHUB_OUTPUT
76-
echo "$delimiter" >> $GITHUB_OUTPUT
72+
# Debug: Show content length
73+
echo "Changelog content size: $(wc -c < version-changelog.md) bytes"
74+
75+
# Save the changelog file path for use in the next step
76+
echo "CHANGELOG_FILE=version-changelog.md" >> $GITHUB_OUTPUT
7777
else
7878
echo "Version $VERSION not found in CHANGELOG.md"
79-
echo "RELEASE_NOTES=## Release v$VERSION" >> $GITHUB_OUTPUT
79+
echo "## Release v$VERSION" > version-changelog.md
80+
echo "CHANGELOG_FILE=version-changelog.md" >> $GITHUB_OUTPUT
8081
fi
8182
else
8283
echo "CHANGELOG.md not found"
83-
echo "RELEASE_NOTES=## Release v$VERSION" >> $GITHUB_OUTPUT
84+
echo "## Release v$VERSION" > version-changelog.md
85+
echo "CHANGELOG_FILE=version-changelog.md" >> $GITHUB_OUTPUT
8486
fi
8587
8688
- name: Finalize GitHub Release
8789
if: success()
8890
run: |
89-
gh release edit v${{ steps.get_version.outputs.VERSION }} --notes "${{ steps.get_changelog.outputs.RELEASE_NOTES }}" --draft=false
91+
if [ -f "${{ steps.get_changelog.outputs.CHANGELOG_FILE }}" ]; then
92+
gh release edit v${{ steps.get_version.outputs.VERSION }} --notes-file "${{ steps.get_changelog.outputs.CHANGELOG_FILE }}" --draft=false
93+
else
94+
gh release edit v${{ steps.get_version.outputs.VERSION }} --notes "## Release v${{ steps.get_version.outputs.VERSION }}" --draft=false
95+
fi
9096
env:
9197
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)