mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
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:
parent
221f1449e1
commit
3e27c518af
3 changed files with 13 additions and 1 deletions
1
.github/workflows/checkPullRequest.yml
vendored
1
.github/workflows/checkPullRequest.yml
vendored
|
|
@ -16,6 +16,7 @@ jobs:
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
branch: master
|
||||||
extra_plugins: |
|
extra_plugins: |
|
||||||
@semantic-release/git
|
@semantic-release/git
|
||||||
@semantic-release/changelog
|
@semantic-release/changelog
|
||||||
|
|
|
||||||
1
.github/workflows/testRelease.yml
vendored
1
.github/workflows/testRelease.yml
vendored
|
|
@ -20,6 +20,7 @@ jobs:
|
||||||
uses: cycjimmy/semantic-release-action@v2
|
uses: cycjimmy/semantic-release-action@v2
|
||||||
id: semantic
|
id: semantic
|
||||||
with:
|
with:
|
||||||
|
branch: master
|
||||||
extra_plugins: |
|
extra_plugins: |
|
||||||
@semantic-release/git
|
@semantic-release/git
|
||||||
@semantic-release/changelog
|
@semantic-release/changelog
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,18 @@ exports.handleBranchOption = () => {
|
||||||
const branchOption = {};
|
const branchOption = {};
|
||||||
const branch = core.getInput(inputs.branch);
|
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;
|
branchOption.branch = branch;
|
||||||
|
} else {
|
||||||
|
branchOption.branches = [branch];
|
||||||
}
|
}
|
||||||
|
|
||||||
return branchOption;
|
return branchOption;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue