Add ssh script execution option

This commit is contained in:
Dragan Filipovic 2023-01-01 14:06:43 +01:00
parent 40f855a08b
commit 28bda61b75
4 changed files with 10 additions and 3 deletions

View File

@ -55,8 +55,8 @@ jobs:
cat index.html cat index.html
- name: e2e Test published ssh-deploy action - name: e2e Test published ssh-deploy action
uses: easingthemes/ssh-deploy@main uses: easingthemes/ssh-deploy@v3.1.0
env: with:
# SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY # SSH_PRIVATE_KEY: $EXAMPLE_SSH_PRIVATE_KEY
# REMOTE_HOST: $EXAMPLE_REMOTE_HOST1 # REMOTE_HOST: $EXAMPLE_REMOTE_HOST1
REMOTE_USER: ${{ env.TEST_USER }} REMOTE_USER: ${{ env.TEST_USER }}
@ -64,3 +64,6 @@ jobs:
SOURCE: "test_project/" SOURCE: "test_project/"
TARGET: "/var/www/html/" TARGET: "/var/www/html/"
EXCLUDE: "/dist/, /node_modules/" EXCLUDE: "/dist/, /node_modules/"
SCRIPT: |
whoami
ls -al

View File

@ -31,6 +31,10 @@ inputs:
description: "An array of folder to exclude" description: "An array of folder to exclude"
required: false required: false
default: "" default: ""
SCRIPT:
description: "Script to run on host machine"
required: false
default: "ls"
outputs: outputs:
status: status:
description: "Status" description: "Status"

0
src/remoteCmd.js Normal file
View File

View File

@ -5,7 +5,7 @@ const validateRsync = (callback = () => {}) => {
const rsyncCli = commandExists("rsync"); const rsyncCli = commandExists("rsync");
if (rsyncCli) { if (rsyncCli) {
console.log('⚠️ [CLI] Rsync exists'); console.log('⚠️ [CLI] Rsync exists');
const rsyncVersion = execSync("rsync --version", { stdio: 'inherit' }); execSync("rsync --version", { stdio: 'inherit' });
return callback(); return callback();
} }