- expand base_branches configuration to support a regex pattern to make it more flexible

- run npm update / upgrade
- recompile dist files
This commit is contained in:
Mike Penz
2021-04-30 10:55:14 +02:00
parent 27a8df8102
commit 72dd6bb3ca
5 changed files with 190 additions and 174 deletions
+11 -5
View File
@@ -131,14 +131,20 @@ export class ReleaseNotes {
// retrieve base branches we allow
const baseBranches =
configuration.base_branches || DefaultConfiguration.base_branches
const allBaseBranchesAllowed = baseBranches.length === 0
const baseBranchPatterns = baseBranches.map(baseBranch => {
return new RegExp(baseBranch.replace('\\\\', '\\'), 'gu')
})
// return only the pull requests associated with this release
// and if the baseBranch is matching the configuration
return pullRequests.filter(pr => {
return (
releaseCommitHashes.includes(pr.mergeCommitSha) &&
(allBaseBranchesAllowed || baseBranches.includes(pr.baseBranch))
)
let keep = releaseCommitHashes.includes(pr.mergeCommitSha)
if (keep && baseBranches.length !== 0) {
keep = baseBranchPatterns.some(pattern => {
return pr.baseBranch.match(pattern) !== null
})
}
return keep
})
}