feat: Add multi source and multi target support

This commit is contained in:
Dragan Filipovic 2023-01-03 02:49:54 +01:00
parent 98ee38d52e
commit 73a65ec97c
9 changed files with 227 additions and 70 deletions

View file

@ -10,12 +10,12 @@ const githubWorkspace = process.env.GITHUB_WORKSPACE;
const remoteUser = process.env.REMOTE_USER;
const defaultInputs = {
source: '',
source: './',
target: `/home/${remoteUser}/`,
exclude: '',
args: '-rltgoDzvO',
sshCmdArgs: '-o StrictHostKeyChecking=no',
deployKeyName: 'deploy_key'
deployKeyName: `deploy_key_${remoteUser}_${Date.now()}`
};
const inputs = {
@ -29,6 +29,9 @@ inputNames.forEach((input) => {
let extendedVal = validVal;
// eslint-disable-next-line default-case
switch (inputName) {
case 'source':
extendedVal = validVal.indexOf(' ') > -1 ? validVal.split(' ') : validVal;
break;
case 'args':
extendedVal = validVal.split(' ');
break;