8 Commits

Author SHA1 Message Date
9085f3ea5b chore: update default timeout to 10 minutes
Some checks failed
remote ssh command / Build (push) Failing after 5s
2019-11-30 23:01:49 +08:00
696aab4627 fix typos in README.md (#12)
fix typos in README.md
2019-11-23 12:12:53 +08:00
a88f6f2013 fix typos in README.md 2019-11-21 15:53:08 +01:00
6f091cd9e3 chore(ssh): remove comma splitting
Some checks failed
remote ssh command / Build (push) Failing after 4s
fix https://github.com/appleboy/ssh-action/issues/10
2019-11-21 11:10:52 +08:00
aa1ecdd19a update doc
Some checks failed
remote ssh command / Build (push) Failing after 3s
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-30 16:55:40 +08:00
bffdd4e1f4 chore(ssh): set default port as 22
fix: https://github.com/appleboy/ssh-action/issues/5

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-30 16:54:44 +08:00
f4890bec77 update action link
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-30 11:35:28 +08:00
9aaf218321 docs: update readme 2019-09-29 14:16:47 +08:00
4 changed files with 83 additions and 55 deletions

View File

@ -43,7 +43,9 @@ jobs:
# key: ${{ secrets.KEY }}
# port: ${{ secrets.PORT }}
# script_stop: true
# script: "mkdir abc/def,ls -al"
# script: |
# mkdir abc/def
# ls -al
- name: pass environment
uses: appleboy/ssh-action@master
@ -56,5 +58,5 @@ jobs:
port: ${{ secrets.PORT }}
envs: FOO
script: |
echo "I am $FOO"
echo "I am $BAR"
echo "I am $FOO, thanks"
echo "I am $BAR, thanks"

View File

@ -1,4 +1,4 @@
FROM appleboy/drone-ssh:1.5.2-linux-amd64
FROM appleboy/drone-ssh:1.5.4-linux-amd64
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

View File

@ -1,6 +1,6 @@
# 🚀 SSH for GitHub Actions
[GitHub Action](https://developer.github.com/actions/) for executing remote ssh commands.
[GitHub Action](https://github.com/features/actions) for executing remote ssh commands.
![ssh workflow](./images/ssh-workflow.png)
@ -11,6 +11,14 @@
Executing remote ssh commands.
```yaml
name: remote ssh command
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
@ -28,21 +36,21 @@ output:
whoami
======END======
out: ***
==========================================
Successfully executed commands to all host.
==========================================
==============================================
Successfully executed commands to all host.
==============================================
```
## Input variables
see the [action.yml](./action.yml) file for more detail imformation.
See [action.yml](./action.yml) for more detailed information.
* host - scp remote host
* port - scp remote port
* username - scp username
* password - scp password
* host - remote host
* port - remote port, default is `22`
* username - ssh username
* password - ssh password
* timeout - timeout for ssh to remote host, default is `30s`
* command_timeout - timeout for scp command, default is `1m`
* command_timeout - timeout for ssh command, default is `10m`
* key - content of ssh private key. ex raw content of ~/.ssh/id_rsa
* key_path - path of ssh private key
* script - execute commands
@ -98,6 +106,7 @@ Multiple Commands
Multiple Hosts
```diff
- name: multiple host
uses: appleboy/ssh-action@master
with:
- host: "foo.com"
@ -113,6 +122,7 @@ Multiple Hosts
Pass environment variable to shell script
```diff
- name: pass environment
uses: appleboy/ssh-action@master
+ env:
+ FOO: "BAR"
@ -129,7 +139,7 @@ Pass environment variable to shell script
Stop script after first failure. ex: missing `abc` folder
```yaml
```diff
- name: stop script if command error
uses: appleboy/ssh-action@master
with:
@ -137,6 +147,21 @@ Stop script after first failure. ex: missing `abc` folder
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script_stop: true
script: "mkdir abc/def,ls -al"
+ script_stop: true
script: |
mkdir abc/def
ls -al
```
output:
```sh
======CMD======
mkdir abc/def
ls -al
======END======
2019/11/21 01:16:21 Process exited with status 1
err: mkdir: cannot create directory abc/def: No such file or directory
##[error]Docker run failed with exit code 1
```

View File

@ -6,6 +6,7 @@ inputs:
description: 'ssh remote host'
port:
description: 'ssh remote port'
default: 22
username:
description: 'ssh username'
password:
@ -15,7 +16,7 @@ inputs:
default: "30s"
command_timeout:
description: 'timeout for ssh command'
default: "1m"
default: "10m"
key:
description: 'content of ssh private key. ex raw content of ~/.ssh/id_rsa'
key_path: