File tree 4 files changed +29
-0
lines changed 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 42
42
set -e
43
43
whoami
44
44
45
+ - name : ssh commands from a file
46
+ uses : ./
47
+ with :
48
+ host : ${{ env.REMOTE_HOST }}
49
+ username : linuxserver.io
50
+ password : password
51
+ port : 2222
52
+ script_path : testdata/test.sh
53
+
45
54
check-ssh-key :
46
55
runs-on : ubuntu-latest
47
56
steps :
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ See [action.yml](./action.yml) for more detailed information.
46
46
| proxy_cipher | Allowed cipher algorithms for the proxy | |
47
47
| proxy_use_insecure_cipher | Include more ciphers with use_insecure_cipher for the proxy | false |
48
48
| script | Execute commands | |
49
+ | script_file | Execute commands from a file | |
49
50
| script_stop | Stop script after first failure | false |
50
51
| envs | Pass environment variables to shell script | |
51
52
| envs_format | Flexible configuration of environment value transfer | |
@@ -222,6 +223,19 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
222
223
223
224

224
225
226
+ #### Commands from a file
227
+
228
+ ` ` ` yaml
229
+ - name : file commands
230
+ uses : appleboy/ssh-action@v1.1.0
231
+ with :
232
+ host : ${{ secrets.HOST }}
233
+ username : ${{ secrets.USERNAME }}
234
+ key : ${{ secrets.KEY }}
235
+ port : ${{ secrets.PORT }}
236
+ script_path : scripts/script.sh
237
+ ` ` `
238
+
225
239
#### Multiple Hosts
226
240
227
241
` ` ` diff
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ inputs:
63
63
description : " Include more ciphers for the proxy by using insecure ciphers."
64
64
script :
65
65
description : " Commands to be executed."
66
+ script_path :
67
+ description : " Path to the file containing commands to be executed."
66
68
script_stop :
67
69
description : " Stop the script after the first failure."
68
70
envs :
@@ -110,6 +112,7 @@ runs:
110
112
INPUT_PROXY_TIMEOUT : ${{ inputs.proxy_timeout }}
111
113
INPUT_COMMAND_TIMEOUT : ${{ inputs.command_timeout }}
112
114
INPUT_SCRIPT : ${{ inputs.script }}
115
+ INPUT_SCRIPT_FILE : ${{ inputs.script_path }}
113
116
INPUT_SCRIPT_STOP : ${{ inputs.script_stop }}
114
117
INPUT_ENVS : ${{ inputs.envs }}
115
118
INPUT_ENVS_FORMAT : ${{ inputs.envs_format }}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -e
3
+ whoami
You can’t perform that action at this time.
0 commit comments