- introduce the ability to reference parent / child PR relationships

- FIX https://github.com/mikepenz/release-changelog-builder-action/issues/1074
- optimize placeholder removal
- only keep placeholders in array if we have values
This commit is contained in:
Mike Penz
2023-06-04 18:48:53 +00:00
committed by GitHub
parent b691df6437
commit 831ac3e7ee
6 changed files with 211 additions and 9 deletions
+21 -1
View File
@@ -266,7 +266,7 @@ pullRequestsWithLabels.push(
repoName: 'test-repo',
labels: ['issue', 'fix'],
milestone: '',
body: 'no magic body for this matter',
body: 'no magic body for this matter - #1',
assignees: [],
requestedReviewers: [],
approvedReviewers: [],
@@ -399,6 +399,26 @@ it('Deduplicate duplicated PRs DESC', async () => {
)
})
it('Reference PRs', async () => {
const customConfig = Object.assign({}, DefaultConfiguration)
customConfig.categories = [
{
title: '',
labels: []
}
]
customConfig.pr_template = "${{NUMBER}} -- ${{REFERENCED[*].number}}"
customConfig.reference = {
pattern: '.*\ \#(.).*',
on_property: 'body',
method: 'replace',
target: '$1'
}
expect(buildChangelogTest(customConfig, pullRequestsWithLabels)).toStrictEqual(
`1 -- 2\n4 -- \n3 -- \n\n`
)
})
it('Use empty_content for empty category', async () => {
const customConfig = Object.assign({}, DefaultConfiguration)
customConfig.categories = [