fix(ci): Match scoped conventional-commit prefixes in changelog script
The type regex only matched "type: ", so scoped commits like "fix(web): ..." all fell into the catch-all Other section instead of their proper one.
This commit is contained in:
1 parent
4e635bd27c
commit
4b78236a01
1 file changed
+2
-2
@@ -27,14 +27,14 @@ label_for() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
commits=$(git log ${range} --reverse --pretty='format:%s')
|
commits=$(git log ${range} --reverse --pretty='format:%s')
|
||||||
known_pattern="^(feat|fix|refactor|perf|docs|test|ci|build|chore): "
|
known_pattern="^(feat|fix|refactor|perf|docs|test|ci|build|chore)(\([^)]*\))?!?: "
|
||||||
|
|
||||||
first_section=1
|
first_section=1
|
||||||
for type in $types other; do
|
for type in $types other; do
|
||||||
if [ "$type" = "other" ]; then
|
if [ "$type" = "other" ]; then
|
||||||
entries=$(printf '%s\n' "$commits" | grep -v -E "$known_pattern" | sed 's/^/- /' || true)
|
entries=$(printf '%s\n' "$commits" | grep -v -E "$known_pattern" | sed 's/^/- /' || true)
|
||||||
else
|
else
|
||||||
entries=$(printf '%s\n' "$commits" | grep -E "^${type}: " | sed -E "s/^${type}: /- /" || true)
|
entries=$(printf '%s\n' "$commits" | grep -E "^${type}(\([^)]*\))?!?: " | sed -E "s/^${type}(\([^)]*\))?!?: /- /" || true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$entries" ] && continue
|
[ -z "$entries" ] && continue
|
||||||
|
|||||||
Reference in new issue
Block a user