@@ -12,10 +12,10 @@ void async function main() {
1212} ( )
1313
1414async function ssh ( ) {
15- let ssh = `${ process . env [ 'HOME' ] } /.ssh`
15+ let sshHomeDir = `${ process . env [ 'HOME' ] } /.ssh`
1616
17- if ( ! fs . existsSync ( ssh ) ) {
18- fs . mkdirSync ( ssh )
17+ if ( ! fs . existsSync ( sshHomeDir ) ) {
18+ fs . mkdirSync ( sshHomeDir )
1919 }
2020
2121 let authSock = '/tmp/ssh-auth.sock'
@@ -27,17 +27,17 @@ async function ssh() {
2727
2828 const knownHosts = core . getInput ( 'known-hosts' )
2929 if ( knownHosts !== '' ) {
30- fs . appendFileSync ( `${ ssh } /known_hosts` , knownHosts )
31- fs . chmodSync ( `${ ssh } /known_hosts` , '600' )
30+ fs . appendFileSync ( `${ sshHomeDir } /known_hosts` , knownHosts )
31+ fs . chmodSync ( `${ sshHomeDir } /known_hosts` , '600' )
3232 } else {
33- fs . appendFileSync ( `${ ssh } /config` , `StrictHostKeyChecking no` )
34- fs . chmodSync ( `${ ssh } /config` , '600' )
33+ fs . appendFileSync ( `${ sshHomeDir } /config` , `StrictHostKeyChecking no` )
34+ fs . chmodSync ( `${ sshHomeDir } /config` , '600' )
3535 }
3636
37- const sshConfig = core . getInput ( 'ssh-config' )
37+ let sshConfig = core . getInput ( 'ssh-config' )
3838 if ( sshConfig !== '' ) {
39- fs . writeFileSync ( `${ ssh } /config` , sshConfig )
40- fs . chmodSync ( `${ ssh } /config` , '600' )
39+ fs . writeFileSync ( `${ sshHomeDir } /config` , sshConfig )
40+ fs . chmodSync ( `${ sshHomeDir } /config` , '600' )
4141 }
4242}
4343
@@ -51,12 +51,20 @@ async function dep() {
5151 }
5252
5353 if ( ! dep ) {
54- execa . commandSync ( 'curl -LO https://deployer.org/deployer.phar' )
54+ let version = core . getInput ( 'deployer-version' )
55+ if ( version === '' ) {
56+ execa . commandSync ( 'curl -LO https://deployer.org/deployer.phar' )
57+ } else {
58+ if ( ! / ^ v / . test ( version ) ) {
59+ version = 'v' + version
60+ }
61+ execa . commandSync ( `curl -LO https://deployer.org/releases/${ version } /deployer.phar` )
62+ }
5563 execa . commandSync ( 'sudo chmod +x deployer.phar' )
5664 dep = 'deployer.phar'
5765 }
5866
59- let p = execa . command ( `php ${ dep } ${ core . getInput ( 'dep' ) } ` )
67+ let p = execa . command ( `php ${ dep } --ansi -v ${ core . getInput ( 'dep' ) } ` )
6068 p . stdout . pipe ( process . stdout )
6169 p . stderr . pipe ( process . stderr )
6270 try {
0 commit comments