refactor(*): split tasks and modules

This commit is contained in:
cycjimmy 2019-10-26 19:19:39 +08:00
parent 9d624df62a
commit feb118b68d
7 changed files with 123 additions and 82 deletions

21
src/handleOptions.js Normal file
View file

@ -0,0 +1,21 @@
const core = require('@actions/core');
const inputs = require('./inputs.json');
/**
* handleDryRunOption
* @returns {{}|{dryRun: boolean}}
*/
exports.handleDryRunOption = () => {
const dryRun = core.getInput(inputs.dry_run, {required: false}) || '';
switch (dryRun) {
case 'true':
return {dryRun: true};
case 'false':
return {dryRun: false};
default:
return {};
}
};