From b322cd92854e4f02f527e9558fbc4a69ab076580 Mon Sep 17 00:00:00 2001 From: Daniel Doblado Date: Thu, 8 Oct 2020 11:21:00 +0200 Subject: [PATCH] Support nested release branches (#36) --- CHANGELOG.md | 5 +++++ dist/index.js | 4 ++-- src/index.js | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bee4c198..4ba4c156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## [1.5.0] - 07.10.2020 + +### Added +- Support nested release branches + ## [1.4.0] - 15.09.2020 ### Added diff --git a/dist/index.js b/dist/index.js index 3e57eb1a..3e5e63f2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10161,7 +10161,7 @@ const run = async () => { } = validateChangelog(changelogContent); // Checks if the branch is release or once of release_branches input. - if (releaseBranches.includes(branch)) { + if (releaseBranches.find((releaseBranch) => branch.startsWith(releaseBranch))) { if (isUnreleased) { throw new Error(`"${branch}" branch can't be unreleased`); } @@ -10190,7 +10190,7 @@ const run = async () => { // Validate if branch contains breaking changes // and version has the same major version as previous. - if (branch === 'release') { + if (branch.startsWith('release')) { const text = skeleton.versionText[version].map((v) => v.value).join(); const previousVersion = skeleton.versions[1]; if ( diff --git a/src/index.js b/src/index.js index efcdca30..0d1b201f 100644 --- a/src/index.js +++ b/src/index.js @@ -61,7 +61,7 @@ const run = async () => { } = validateChangelog(changelogContent); // Checks if the branch is release or once of release_branches input. - if (releaseBranches.includes(branch)) { + if (releaseBranches.find((releaseBranch) => branch.startsWith(releaseBranch))) { if (isUnreleased) { throw new Error(`"${branch}" branch can't be unreleased`); } @@ -90,7 +90,7 @@ const run = async () => { // Validate if branch contains breaking changes // and version has the same major version as previous. - if (branch === 'release') { + if (branch.startsWith('release')) { const text = skeleton.versionText[version].map((v) => v.value).join(); const previousVersion = skeleton.versions[1]; if (