diff --git a/extend/base/common/command/admin/VersionBase.php b/extend/base/common/command/admin/VersionBase.php index 4dfc1f1..d2937ab 100644 --- a/extend/base/common/command/admin/VersionBase.php +++ b/extend/base/common/command/admin/VersionBase.php @@ -349,8 +349,9 @@ class VersionBase extends Command $message = $parts[2] ?? $commit; $matched = false; foreach (static::COMMIT_TYPES as $type => $desc) { - if (preg_match("/^{$type}:/i", $message)) { - $cleanMessage = preg_replace("/^{$type}:/i", '', $message); + // 支持 type: message 和 type(scope): message 两种格式 + if (preg_match("/^{$type}(\([^)]*\))?\s*:/i", $message)) { + $cleanMessage = preg_replace("/^{$type}(\([^)]*\))?\s*:\s*/i", '', $message); $groupedCommits[$desc][] = $formatCallback($cleanMessage, $commit); $matched = true; break;