From c17d254b53c971e4edbf6d7c4487b82b585a785d Mon Sep 17 00:00:00 2001 From: zivan Date: Tue, 21 Sep 2021 02:23:18 +0700 Subject: [PATCH] fixing relative path and permission (#24) * fix relative path * fix chmod 600 .ssh/known_hosts and .ssh/config --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 427f8b8..66f9b10 100644 --- a/index.js +++ b/index.js @@ -29,14 +29,16 @@ function ssh() { const knownHosts = core.getInput('known-hosts') if (knownHosts !== '') { fs.appendFileSync(`${ssh}/known_hosts`, knownHosts) - fs.chmodSync(`${ssh}/known_hosts`, '644') + fs.chmodSync(`${ssh}/known_hosts`, '600') } else { fs.appendFileSync(`${ssh}/config`, `StrictHostKeyChecking no`) + fs.chmodSync(`${ssh}/config`, '600') } const sshConfig = core.getInput('ssh-config') if (sshConfig !== '') { fs.writeFile(`${ssh}/config`, sshConfig) + fs.chmodSync(`${ssh}/config`, '600') } } @@ -52,7 +54,7 @@ function dep() { if (!dep) { execa.commandSync('curl -LO https://deployer.org/deployer.phar') execa.commandSync('sudo chmod +x deployer.phar') - dep = 'deployer.phar' + dep = './deployer.phar' } const subprocess = execa(dep, split(core.getInput('dep')))