mirror of
https://github.com/deployphp/action.git
synced 2025-04-01 19:06:35 +00:00
fix chmod 600 .ssh/known_hosts and .ssh/config
This commit is contained in:
parent
879d527eb5
commit
e65a347817
1 changed files with 3 additions and 1 deletions
4
index.js
4
index.js
|
@ -29,14 +29,16 @@ function ssh() {
|
||||||
const knownHosts = core.getInput('known-hosts')
|
const knownHosts = core.getInput('known-hosts')
|
||||||
if (knownHosts !== '') {
|
if (knownHosts !== '') {
|
||||||
fs.appendFileSync(`${ssh}/known_hosts`, knownHosts)
|
fs.appendFileSync(`${ssh}/known_hosts`, knownHosts)
|
||||||
fs.chmodSync(`${ssh}/known_hosts`, '644')
|
fs.chmodSync(`${ssh}/known_hosts`, '600')
|
||||||
} else {
|
} else {
|
||||||
fs.appendFileSync(`${ssh}/config`, `StrictHostKeyChecking no`)
|
fs.appendFileSync(`${ssh}/config`, `StrictHostKeyChecking no`)
|
||||||
|
fs.chmodSync(`${ssh}/config`, '600')
|
||||||
}
|
}
|
||||||
|
|
||||||
const sshConfig = core.getInput('ssh-config')
|
const sshConfig = core.getInput('ssh-config')
|
||||||
if (sshConfig !== '') {
|
if (sshConfig !== '') {
|
||||||
fs.writeFile(`${ssh}/config`, sshConfig)
|
fs.writeFile(`${ssh}/config`, sshConfig)
|
||||||
|
fs.chmodSync(`${ssh}/config`, '600')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue