From 953b1f98c97c3e8948c285d662718938c770b32a Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 4 Feb 2026 15:00:31 +0900 Subject: [PATCH] fix(ci): use regex variables for bash 5.2+ compatibility in changelog generation --- .github/workflows/publish.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e7af8c091..6128da27e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -255,35 +255,43 @@ jobs: DOCS="" OTHER="" + # Store regexes in variables for bash 5.2+ compatibility + # (bash 5.2 changed how parentheses are parsed inside [[ =~ ]]) + re_skip='^(chore|ci|release|test|ignore)' + re_feat_scoped='^feat\(([^)]+)\): (.+)$' + re_fix_scoped='^fix\(([^)]+)\): (.+)$' + re_refactor_scoped='^refactor\(([^)]+)\): (.+)$' + re_docs_scoped='^docs\(([^)]+)\): (.+)$' + while IFS= read -r commit; do [ -z "$commit" ] && continue # Skip chore, ci, release, test commits - [[ "$commit" =~ ^(chore|ci|release|test|ignore) ]] && continue + [[ "$commit" =~ $re_skip ]] && continue if [[ "$commit" =~ ^feat ]]; then # Extract scope and message: feat(scope): message -> **scope**: message - if [[ "$commit" =~ ^feat\(([^)]+)\):\ (.+)$ ]]; then + if [[ "$commit" =~ $re_feat_scoped ]]; then FEATURES="${FEATURES}\n- **${BASH_REMATCH[1]}**: ${BASH_REMATCH[2]}" else MSG="${commit#feat: }" FEATURES="${FEATURES}\n- ${MSG}" fi elif [[ "$commit" =~ ^fix ]]; then - if [[ "$commit" =~ ^fix\(([^)]+)\):\ (.+)$ ]]; then + if [[ "$commit" =~ $re_fix_scoped ]]; then FIXES="${FIXES}\n- **${BASH_REMATCH[1]}**: ${BASH_REMATCH[2]}" else MSG="${commit#fix: }" FIXES="${FIXES}\n- ${MSG}" fi elif [[ "$commit" =~ ^refactor ]]; then - if [[ "$commit" =~ ^refactor\(([^)]+)\):\ (.+)$ ]]; then + if [[ "$commit" =~ $re_refactor_scoped ]]; then REFACTOR="${REFACTOR}\n- **${BASH_REMATCH[1]}**: ${BASH_REMATCH[2]}" else MSG="${commit#refactor: }" REFACTOR="${REFACTOR}\n- ${MSG}" fi elif [[ "$commit" =~ ^docs ]]; then - if [[ "$commit" =~ ^docs\(([^)]+)\):\ (.+)$ ]]; then + if [[ "$commit" =~ $re_docs_scoped ]]; then DOCS="${DOCS}\n- **${BASH_REMATCH[1]}**: ${BASH_REMATCH[2]}" else MSG="${commit#docs: }"