@@ -130,18 +130,34 @@ jobs:
130130 COMMIT_DATE=$(echo "$line" | cut -d'|||' -f4)
131131 SHORT_HASH=${COMMIT_HASH:0:7}
132132
133- if [[ "$COMMIT_MSG" =~ ^FEATURE[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
134- AREA="${BASH_REMATCH[1]}"
135- DESC="${BASH_REMATCH[2]}"
136- FEATURES="${FEATURES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
137- elif [[ "$COMMIT_MSG" =~ ^FIX[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
138- AREA="${BASH_REMATCH[1]}"
139- DESC="${BASH_REMATCH[2]}"
140- FIXES="${FIXES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
141- elif [[ "$COMMIT_MSG" =~ ^REFACTOR[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
142- AREA="${BASH_REMATCH[1]}"
143- DESC="${BASH_REMATCH[2]}"
144- REFACTORS="${REFACTORS}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
133+ # Parse commit message format: TYPE (area): description
134+ if [[ "$COMMIT_MSG" == FEATURE* ]]; then
135+ # Extract area and description
136+ TEMP="${COMMIT_MSG#FEATURE}"
137+ TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
138+ if [[ "$TEMP" == \(* ]]; then
139+ AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
140+ DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
141+ FEATURES="${FEATURES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
142+ fi
143+ elif [[ "$COMMIT_MSG" == FIX* ]]; then
144+ # Extract area and description
145+ TEMP="${COMMIT_MSG#FIX}"
146+ TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
147+ if [[ "$TEMP" == \(* ]]; then
148+ AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
149+ DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
150+ FIXES="${FIXES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
151+ fi
152+ elif [[ "$COMMIT_MSG" == REFACTOR* ]]; then
153+ # Extract area and description
154+ TEMP="${COMMIT_MSG#REFACTOR}"
155+ TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
156+ if [[ "$TEMP" == \(* ]]; then
157+ AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
158+ DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
159+ REFACTORS="${REFACTORS}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
160+ fi
145161 fi
146162 fi
147163 done <<< "$COMMITS"
0 commit comments