From 801656d2abcc479b548da2ec98f8aa4738222c54 Mon Sep 17 00:00:00 2001 From: Brandon Mikeska Date: Fri, 20 Oct 2023 16:47:21 -0500 Subject: [PATCH] Fix multiple workItem filters spread out the filters before pushing --- packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts | 2 +- .../tests/impl/changelog/WorkItemUpdater.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts b/packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts index 9d8533393..fcaa41dca 100644 --- a/packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts +++ b/packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts @@ -79,7 +79,7 @@ export default class ReleaseImpl { for (const releaseDefinition of this.props.releaseDefinitions) { releaseName = releaseName.concat(releaseDefinition.release, '-'); if (releaseDefinition.changelog) { - workitemFilters.push(releaseDefinition.changelog?.workItemFilters); + workitemFilters.push(...releaseDefinition.changelog?.workItemFilters); if (releaseDefinition.changelog.limit > limit) limit = releaseDefinition.changelog.limit; workItemUrl = releaseDefinition.changelog.workItemUrl; showAllArtifacts = releaseDefinition.changelog.showAllArtifacts; diff --git a/packages/sfpowerscripts-cli/tests/impl/changelog/WorkItemUpdater.test.ts b/packages/sfpowerscripts-cli/tests/impl/changelog/WorkItemUpdater.test.ts index 4b4c53a0e..d4bba472e 100644 --- a/packages/sfpowerscripts-cli/tests/impl/changelog/WorkItemUpdater.test.ts +++ b/packages/sfpowerscripts-cli/tests/impl/changelog/WorkItemUpdater.test.ts @@ -8,7 +8,7 @@ describe('Given a WorkItemUpdater', () => { const resourceDir: string = path.join(__dirname, 'resources'); it('should update latestRelease with work items', () => { - new WorkItemUpdater(latestRelease, ['NGV-[0-9]{3,4}']).update(); + new WorkItemUpdater(latestRelease, ['NGV-[0-9]{3,4}', 'TEST-[0-9]{3,4}']).update(); expect(latestRelease).toEqual( fs.readJSONSync(