- add ability to provide key for cateogry, used for json ('categorized') output

This commit is contained in:
Mike Penz
2023-05-25 17:59:11 +00:00
committed by GitHub
parent be9b53104e
commit 5d46efec54
5 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -180,7 +180,9 @@ export function buildChangelog(diffInfo: DiffInfo, prs: PullRequestInfo[], optio
core.info(`️ Ordered all pull requests into ${categories.length} categories`)
// serialize and provide the categorized content as json
const transformedCategorized = Array.from(categorized).reduce((obj, [key, value]) => Object.assign(obj, {[key.title]: value}), {})
const transformedCategorized = Array.from(categorized).reduce(
(obj, [key, value]) => Object.assign(obj, {[key.key || key.title]: value}), {}
)
core.setOutput('categorized', JSON.stringify(transformedCategorized))
// construct final changelog