Skip to content

Conversation

@JasonXuDeveloper
Copy link
Owner

Summary

  • Fix bash syntax error in release workflow changelog generation
  • Store regex pattern in variable to avoid parsing issues

Problem

The release workflow was failing with:

syntax error in conditional expression: unexpected token `)'

The regex pattern ^([a-z]+)(\(([^)]+)\))?!?:\ (.+)$ contains parentheses and brackets that bash was misinterpreting during script expansion.

Solution

Store the regex pattern in a variable first:

COMMIT_PATTERN='^([a-z]+)(\(([^)]+)\))?!?:[[:space:]](.+)$'
if [[ $subject =~ $COMMIT_PATTERN ]]; then

This prevents bash from parsing the special characters during expansion.

Test plan

  • Run the release workflow again after merging
  • Verify changelog generation works correctly
  • Check that conventional commits are properly parsed

🤖 Generated with Claude Code

The regex pattern for parsing conventional commits contained special
characters (parentheses, brackets) that bash was misinterpreting,
causing "syntax error in conditional expression: unexpected token ')'"

Fix by storing the pattern in a variable first, which prevents bash
from parsing the special characters during script expansion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) January 25, 2026 06:13
@claude
Copy link

claude bot commented Jan 25, 2026

Code review

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

@JasonXuDeveloper JasonXuDeveloper merged commit 03efea1 into master Jan 25, 2026
7 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the fix/release-changelog-regex branch January 25, 2026 06:15
@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 restored the fix/release-changelog-regex branch January 25, 2026 08:46
@JasonXuDeveloper JasonXuDeveloper deleted the fix/release-changelog-regex branch January 25, 2026 09:03
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