mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2026-04-09 00:30:03 +00:00
fix(inputs): adjust the default for the "branch" configuration
This commit is contained in:
parent
56568e2822
commit
e5c555a613
4 changed files with 20 additions and 9 deletions
|
|
@ -2,7 +2,22 @@ const core = require('@actions/core');
|
|||
const inputs = require('./inputs.json');
|
||||
|
||||
/**
|
||||
* handleDryRunOption
|
||||
* Handle Branch Option
|
||||
* @returns {{}|{branch: string}}
|
||||
*/
|
||||
exports.handleBranchOption = () => {
|
||||
const branchOption = {};
|
||||
const branch = core.getInput(inputs.branch);
|
||||
|
||||
if (branch) {
|
||||
branchOption.branch = branch;
|
||||
}
|
||||
|
||||
return branchOption;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle DryRun Option
|
||||
* @returns {{}|{dryRun: boolean}}
|
||||
*/
|
||||
exports.handleDryRunOption = () => {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
const core = require('@actions/core');
|
||||
const semanticRelease = require('semantic-release');
|
||||
const {handleDryRunOption} = require('./handleOptions');
|
||||
const {handleBranchOption, handleDryRunOption} = require('./handleOptions');
|
||||
const setUpJob = require('./setUpJob.task');
|
||||
const preInstallPlugins = require('./preInstallPlugins.task');
|
||||
const cleanupNpmrc = require('./cleanupNpmrc.task');
|
||||
const windUpJob = require('./windUpJob.task');
|
||||
|
||||
const inputs = require('./inputs.json');
|
||||
|
||||
/**
|
||||
* Release main task
|
||||
* @returns {Promise<void>}
|
||||
|
|
@ -16,9 +14,8 @@ const release = async () => {
|
|||
await setUpJob();
|
||||
await preInstallPlugins();
|
||||
|
||||
const branch = core.getInput(inputs.branch) || 'master';
|
||||
const result = await semanticRelease({
|
||||
branch,
|
||||
...(handleBranchOption()),
|
||||
...(handleDryRunOption()),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue