- 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
+11 -2
View File
@@ -3,7 +3,7 @@ export interface Configuration {
max_pull_requests: number
max_back_track_time_days: number
exclude_merge_branches: string[]
sort: string // "ASC" or "DESC"
sort: Sort | string // "ASC" or "DESC"
template: string
pr_template: string
empty_template: string
@@ -23,6 +23,11 @@ export interface Category {
exhaustive?: boolean // requires all labels to be present in the PR
}
export interface Sort {
order: 'ASC' | 'DESC' // the sorting order
on_property: 'mergedAt' | 'title' // the property to sort on. (mergedAt falls back to createdAt)
}
export interface Regex {
pattern: string // the regex pattern to match
flags?: string // the regex flag to use for RegExp
@@ -55,7 +60,11 @@ export const DefaultConfiguration: Configuration = {
max_pull_requests: 200, // the amount of pull requests to process
max_back_track_time_days: 365, // allow max of 365 days back to check up on pull requests
exclude_merge_branches: [], // branches to exclude from counting as PRs (e.g. YourOrg/qa, YourOrg/main)
sort: 'ASC', // sorting order for filling the changelog (ASC or DESC) supported
sort: {
// defines the sorting logic for PRs
order: 'ASC', // the sorting order
on_property: 'mergedAt' // the property to sort on. (mergedAt falls back to createdAt)
},
template: '${{CHANGELOG}}', // the global template to host the changelog
pr_template: '- ${{TITLE}}\n - PR: #${{NUMBER}}', // the per PR template to pick
empty_template: '- no changes', // the template to use if no pull requests are found