Skip to content

Conversation

@JasonXuDeveloper
Copy link
Owner

Summary

Fixes two issues with the README update logic in the release workflow from PR #566:

Issue 1: sed c\ command doesn't work with multiline content

The previous approach used:

sed -i '/pattern/,/pattern/c\'"$NEW_SECTION" README.md

This fails on Linux because sed's c\ command doesn't handle multiline variables properly.

Fix: Use awk instead, which handles multiline replacement reliably:

awk '
  /^## 🎉 Latest Features/ { skip=1; while((getline < file) > 0) print; }
  /^\[📋 View Complete Changelog\]/ { skip=0; next }
  !skip { print }
' README.md

Issue 2: Feature extraction edge cases

  • When concatenating FEATURES and FIXES, empty strings could create leading newlines
  • Empty lines weren't being filtered out

Fix: Added proper checks before concatenation and filter empty lines with sed '/^$/d'

Changes

  • Replace sed -i ... c\ with awk for both README.md and README_zh_cn.md
  • Write replacement content to temp file first
  • Fix feature/fix concatenation logic
  • Filter empty lines from extracted features

Test plan

  • Run release workflow and verify README.md is updated correctly
  • Verify README_zh_cn.md is updated correctly
  • Check that empty changelog sections don't create extra blank lines

🤖 Generated with Claude Code

The sed 'c\' command doesn't work reliably with multiline content
on Linux. This change:
- Uses awk instead of sed for replacing README sections
- Fixes feature extraction edge cases with empty lines
- Writes replacement content to temp file first

Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
@JasonXuDeveloper JasonXuDeveloper force-pushed the fix/release-readme-update branch from 21118fd to 26ec3a4 Compare January 25, 2026 09:11
@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) January 25, 2026 09:13
@claude
Copy link

claude bot commented Jan 25, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions
Copy link

Unity Test Results

EditMode: All tests passed
PlayMode: All tests passed

Unity Version: 2022.3.55f1
Project Path: UnityProject

✅ All tests passed! The PR is ready for review.

View workflow run

Click here to view the full workflow run

@JasonXuDeveloper JasonXuDeveloper merged commit 8a3baa4 into master Jan 25, 2026
11 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the fix/release-readme-update branch January 25, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants