- add ability to provide key for cateogry, used for json ('categorized') output
This commit is contained in:
@@ -19,6 +19,7 @@ export interface Configuration {
|
||||
}
|
||||
|
||||
export interface Category {
|
||||
key?: string // a key for this category. This is currently only used for the json output
|
||||
title: string // the title of this category
|
||||
labels?: string[] // labels to associate PRs to this category
|
||||
exclude_labels?: string[] // if an exclude label is detected, the PR will be excluded from this category
|
||||
|
||||
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user