mirror of
https://github.com/deployphp/action.git
synced 2025-06-28 20:24:14 +00:00
Set private-key
as non required (#49)
Co-authored-by: benjaminmal <bbenben778@gmail.com>
This commit is contained in:
parent
56e7af68da
commit
162add4f19
3 changed files with 17 additions and 13 deletions
7
index.js
7
index.js
|
@ -22,8 +22,11 @@ async function ssh() {
|
|||
execa.sync('ssh-agent', ['-a', authSock])
|
||||
core.exportVariable('SSH_AUTH_SOCK', authSock)
|
||||
|
||||
let privateKey = core.getInput('private-key').replace('/\r/g', '').trim() + '\n'
|
||||
execa.sync('ssh-add', ['-'], {input: privateKey})
|
||||
let privateKey = core.getInput('private-key')
|
||||
if (privateKey !== '') {
|
||||
privateKey = privateKey.replace('/\r/g', '').trim() + '\n'
|
||||
execa.sync('ssh-add', ['-'], {input: privateKey})
|
||||
}
|
||||
|
||||
const knownHosts = core.getInput('known-hosts')
|
||||
if (knownHosts !== '') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue