From 7e7db1adb37b3b405009c10e80f2c81032be6b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JasonXuDeveloper=20-=20=E5=82=91?= Date: Sun, 25 Jan 2026 17:12:35 +1100 Subject: [PATCH] fix(ci): store regex in variable to fix bash parsing error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: JasonXuDeveloper - 傑 --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07eca03f..7a475a5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -177,11 +177,14 @@ jobs: OTHER="" CONTRIBUTORS="" + # Store regex in variable to avoid bash parsing issues with special characters + COMMIT_PATTERN='^([a-z]+)(\(([^)]+)\))?!?:[[:space:]](.+)$' + while IFS='|' read -r hash subject author; do [ -z "$hash" ] && continue # Extract commit type and scope - if [[ $subject =~ ^([a-z]+)(\(([^)]+)\))?!?:\ (.+)$ ]]; then + if [[ $subject =~ $COMMIT_PATTERN ]]; then type="${BASH_REMATCH[1]}" scope="${BASH_REMATCH[3]}" description="${BASH_REMATCH[4]}"