diff --git a/README.md b/README.md index a28e2b7..02ae326 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,9 @@ This configuration is a `.json` file in the following format. "tag_resolver": { "method": "semver" }, - "base_branches": [] + "base_branches": [ + "dev" + ] } ``` diff --git a/configs_test/configuration_base_branches_develop.json b/configs_test/configuration_base_branches_develop.json index dc1f435..ab7f59a 100644 --- a/configs_test/configuration_base_branches_develop.json +++ b/configs_test/configuration_base_branches_develop.json @@ -1,19 +1,24 @@ { - "categories": [ - { - "title": "", - "labels": ["dev", "Bump"] - } - ], - "ignore_labels": [], - "sort": "DESC", - "pr_template": "${{NUMBER}}", - "label_extractor": [ - { - "pattern": ".*(dev|Bump).*", - "target": "$1", - "on_property": "title" - } - ], - "base_branches": ["develop"] + "categories": [ + { + "title": "", + "labels": [ + "dev", + "Bump" + ] + } + ], + "ignore_labels": [], + "sort": "DESC", + "pr_template": "${{NUMBER}}", + "label_extractor": [ + { + "pattern": ".*(dev|Bump).*", + "target": "$1", + "on_property": "title" + } + ], + "base_branches": [ + "develop" + ] } \ No newline at end of file diff --git a/configs_test/configuration_base_branches_main.json b/configs_test/configuration_base_branches_main.json index 6a14020..6310639 100644 --- a/configs_test/configuration_base_branches_main.json +++ b/configs_test/configuration_base_branches_main.json @@ -1,19 +1,24 @@ { - "categories": [ - { - "title": "", - "labels": ["dev", "Bump"] - } - ], - "ignore_labels": [], - "sort": "DESC", - "pr_template": "${{NUMBER}}", - "label_extractor": [ - { - "pattern": ".*(dev|Bump).*", - "target": "$1", - "on_property": "title" - } - ], - "base_branches": ["main"] + "categories": [ + { + "title": "", + "labels": [ + "dev", + "Bump" + ] + } + ], + "ignore_labels": [], + "sort": "DESC", + "pr_template": "${{NUMBER}}", + "label_extractor": [ + { + "pattern": ".*(dev|Bump).*", + "target": "$1", + "on_property": "title" + } + ], + "base_branches": [ + "main" + ] } \ No newline at end of file diff --git a/src/releaseNotes.ts b/src/releaseNotes.ts index 4d4500b..c7d4d27 100755 --- a/src/releaseNotes.ts +++ b/src/releaseNotes.ts @@ -128,11 +128,12 @@ export class ReleaseNotes { return commmit.sha }) + // retrieve base branches we allow + const baseBranches = configuration.base_branches || DefaultConfiguration.base_branches + const allBaseBranchesAllowed = baseBranches.length === 0 + // return only the pull requests associated with this release return pullRequests.filter(pr => { - const baseBranches = configuration.base_branches || DefaultConfiguration.base_branches - const allBaseBranchesAllowed = baseBranches.length === 0 - return releaseCommitHashes.includes(pr.mergeCommitSha) && (allBaseBranchesAllowed || baseBranches.includes(pr.baseBranch)) })