Skip to content

Commit

Permalink
🐛 Fix multiline changelog parsing in GitHub release creation
Browse files Browse the repository at this point in the history
- 🔧 Updated the `Create or Update Base Release` step in auto-release workflow
- 🔀 Added `env` section to properly handle multiline changelog
- 📦 Used `toJSON` function to safely pass changelog content
- 🔍 Changed changelog parsing from direct string to `JSON.parse(process.env.CHANGELOG)`
- 🚀 This fix ensures that multiline changelogs are correctly processed
- 💬 Prevents potential issues with special characters or line breaks in commit messages
- 📊 Improves reliability of changelog display in GitHub releases

This update addresses a potential issue where multiline changelogs might not be correctly parsed when creating or updating GitHub releases. By using `toJSON` and `JSON.parse`, we ensure that the full changelog content, including any special characters or line breaks, is accurately preserved and displayed in the release notes. This change complements the previous update to include full commit messages, ensuring that all commit information is properly captured and presented in the release documentation.
  • Loading branch information
yuri-val committed Oct 21, 2024
1 parent afb8369 commit 1e204c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ jobs:
- name: Create or Update Base Release
uses: actions/github-script@v6
env:
CHANGELOG: ${{ toJSON(steps.generate_changelog.outputs.CHANGELOG) }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const baseVersion = `${{ steps.get_base_version.outputs.BASE_VERSION }}`;
const fullVersion = `${{ steps.get_tag.outputs.TAG }}`;
const changelog = `${{ steps.generate_changelog.outputs.CHANGELOG }}`;
const changelog = JSON.parse(process.env.CHANGELOG);
const owner = context.repo.owner;
const repo = context.repo.repo;
const tagName = baseVersion;
Expand Down

0 comments on commit 1e204c1

Please sign in to comment.