- expand configuration specification by offering sorting by alternative properties -> title instead of mergedAt.

- add more testcases to cover the new sort orders
  - FIX https://github.com/mikepenz/release-changelog-builder-action/issues/757
This commit is contained in:
Mike Penz
2022-05-13 11:28:46 +02:00
parent 91d5ed10ec
commit 0bb7bd0176
10 changed files with 185 additions and 59 deletions
+2 -3
View File
@@ -15,8 +15,7 @@ export function buildChangelog(
// sort to target order
const config = options.configuration
const sort = config.sort || DefaultConfiguration.sort
const sortAsc = sort.toUpperCase() === 'ASC'
prs = sortPullRequests(prs, sortAsc)
prs = sortPullRequests(prs, sort)
core.info(`️ Sorted all pull requests ascending: ${sort}`)
// drop duplicate pull requests
@@ -44,7 +43,7 @@ export function buildChangelog(
core.info(
`️ Removed ${removedElements} pull requests during deduplication`
)
prs = sortPullRequests(deduplicatedPRs, sortAsc) // resort deduplicatedPRs
prs = sortPullRequests(deduplicatedPRs, sort) // resort deduplicatedPRs
} else {
core.warning(`⚠️ Configured \`duplicate_filter\` invalid.`)
}