diff --git a/RoboFile.php b/RoboFile.php index cd119deca..493c5f376 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -611,7 +611,7 @@ public function buildFaData() { } } - public function buildLog($a, $b) { + public function buildLog($a, $b = 'HEAD') { $log = ConventionalChangelog::buildLog($a, $b); echo implode(PHP_EOL, $log); } @@ -794,9 +794,9 @@ public static function filterCommits($commits) { 'build', 'chore', 'ci', 'docs', 'fix', 'feat', 'perf', 'refactor', 'style', 'test' ]; $types = implode('|', $types); - $scope = "(\([^\)]*\))?"; + $scope = "(\((?P[^\)]*)\))?"; $subject = ".*"; - $filter = "/^(?P$types)(?P$scope):(?P$subject)$/"; + $filter = "/^(?P$types)$scope:(?P$subject)$/"; $filtered = []; $matches = null; foreach ($commits as $commit) { @@ -879,10 +879,13 @@ public static function buildLog($a, $b = 'HEAD') { }); $log = []; - if ($b === '"Unreleaased') { + if ($b === 'HEAD') { array_unshift($tags, $b); } $startRef = array_shift($tags); + if ($startRef === null) { + throw new RuntimeException("$a not found"); + } while ($endRef = array_shift($tags)) { $log = array_merge($log, self::buildLogOneBump($startRef, $endRef)); $startRef = $endRef;