- properly count categorized PRs
This commit is contained in:
+5
-1
@@ -1002,6 +1002,7 @@ function buildChangelog(prs, config, options) {
|
||||
for (const category of categories) {
|
||||
categorized.set(category, []);
|
||||
}
|
||||
const categorizedPrs = [];
|
||||
const uncategorized = [];
|
||||
// bring elements in order
|
||||
for (const [pr, body] of transformedMap) {
|
||||
@@ -1015,6 +1016,9 @@ function buildChangelog(prs, config, options) {
|
||||
if (!matched) {
|
||||
uncategorized.push(body);
|
||||
}
|
||||
else {
|
||||
categorizedPrs.push(body);
|
||||
}
|
||||
}
|
||||
core.info(`ℹ️ Ordered all pull requests into ${categories.length} categories`);
|
||||
// construct final changelog
|
||||
@@ -1040,7 +1044,7 @@ function buildChangelog(prs, config, options) {
|
||||
transformedChangelog = transformedChangelog.replace('${{CHANGELOG}}', changelog);
|
||||
transformedChangelog = transformedChangelog.replace('${{UNCATEGORIZED}}', changelogUncategorized);
|
||||
// fill other placeholders
|
||||
transformedChangelog = transformedChangelog.replace('${{CATEGORIZED_COUNT}}', categorized.size.toString());
|
||||
transformedChangelog = transformedChangelog.replace('${{CATEGORIZED_COUNT}}', categorizedPrs.length.toString());
|
||||
transformedChangelog = transformedChangelog.replace('${{UNCATEGORIZED_COUNT}}', uncategorized.length.toString());
|
||||
transformedChangelog = fillAdditionalPlaceholders(transformedChangelog, options);
|
||||
core.info(`ℹ️ Filled template`);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-1
@@ -45,6 +45,7 @@ export function buildChangelog(
|
||||
for (const category of categories) {
|
||||
categorized.set(category, [])
|
||||
}
|
||||
const categorizedPrs: string[] = []
|
||||
const uncategorized: string[] = []
|
||||
|
||||
// bring elements in order
|
||||
@@ -60,6 +61,8 @@ export function buildChangelog(
|
||||
|
||||
if (!matched) {
|
||||
uncategorized.push(body)
|
||||
} else {
|
||||
categorizedPrs.push(body)
|
||||
}
|
||||
}
|
||||
core.info(`ℹ️ Ordered all pull requests into ${categories.length} categories`)
|
||||
@@ -102,7 +105,7 @@ export function buildChangelog(
|
||||
// fill other placeholders
|
||||
transformedChangelog = transformedChangelog.replace(
|
||||
'${{CATEGORIZED_COUNT}}',
|
||||
categorized.size.toString()
|
||||
categorizedPrs.length.toString()
|
||||
)
|
||||
transformedChangelog = transformedChangelog.replace(
|
||||
'${{UNCATEGORIZED_COUNT}}',
|
||||
|
||||
Reference in New Issue
Block a user