fix(branch): parameter branch does not work in semantic v16

parameter `branch` does not work in semantic v16(#15)

#15
This commit is contained in:
cycjimmy 2020-01-19 10:15:24 +08:00
parent 221f1449e1
commit 3e27c518af
3 changed files with 13 additions and 1 deletions

View file

@ -9,8 +9,18 @@ exports.handleBranchOption = () => {
const branchOption = {};
const branch = core.getInput(inputs.branch);
if (branch) {
if (!branch) {
return branchOption;
}
const semanticVersion = require('semantic-release/package.json').version;
const semanticMajorVersion = Number(semanticVersion.replace(/\..+/g, ''));
core.debug(`semanticMajorVersion: ${semanticMajorVersion}`);
if (semanticMajorVersion < 16) {
branchOption.branch = branch;
} else {
branchOption.branches = [branch];
}
return branchOption;