12
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2026-05-15 13:00:32 +00:00

feat(inputs): add semantic_version to specify version range(#3)

semantic_version: Specify specifying version range for semantic-release. If no version range is
specified, semantic-release@^15 will be used by default.
This commit is contained in:
cycjimmy 2019-11-01 00:06:27 +08:00
parent 56fc83231a
commit 55e8862f17
5 changed files with 33 additions and 1 deletions

View file

@ -0,0 +1,25 @@
const path = require('path');
const core = require('@actions/core');
const exec = require('./_exec');
const inputs = require('./inputs.json');
/**
* Install Specifying Version semantic-release
* @returns {Promise<void>}
*/
module.exports = async () => {
const semantic_version = core.getInput(inputs.semantic_version);
if (!semantic_version) {
return Promise.resolve();
}
const {stdout, stderr} = await exec(`npm install semantic-release@${semantic_version}`, {
cwd: path.resolve(__dirname)
});
core.debug(stdout);
if (stderr) {
return Promise.reject(stderr);
}
};