From e65a347817b8c8da02feec76a28b73e78c4ef9c2 Mon Sep 17 00:00:00 2001 From: zivan Date: Sat, 18 Sep 2021 16:49:24 +0700 Subject: [PATCH] fix chmod 600 .ssh/known_hosts and .ssh/config --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f22568e..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') } }