-
-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(readme): update SSH action and enhance Chinese README files
- Update `appleboy/ssh-action` from version `v1.1.0` to `v1.2.0` in multiple instances - Add `script_file` option to the Chinese (Simplified) and Chinese (Traditional) README files - Add example for executing commands from a file in the Chinese (Simplified) and Chinese (Traditional) README files Signed-off-by: appleboy <[email protected]>
- Loading branch information
Showing
3 changed files
with
65 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: linuxserver.io | ||
|
@@ -184,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
|
||
```yaml | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -197,7 +197,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```yaml | ||
- name: executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -210,7 +210,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```yaml | ||
- name: multiple command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -227,7 +227,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```yaml | ||
- name: file commands | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -240,7 +240,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: "foo.com" | ||
+ host: "foo.com,bar.com" | ||
|
@@ -258,7 +258,7 @@ The default value of `port` is `22`. | |
|
||
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: "foo.com" | ||
+ host: "foo.com:1234,bar.com:5678" | ||
|
@@ -273,7 +273,7 @@ The default value of `port` is `22`. | |
|
||
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: "foo.com,bar.com" | ||
+ sync: true | ||
|
@@ -289,7 +289,7 @@ The default value of `port` is `22`. | |
|
||
```diff | ||
- name: pass environment | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
+ env: | ||
+ FOO: "BAR" | ||
+ BAR: "FOO" | ||
|
@@ -314,7 +314,7 @@ _Inside `env` object, you need to pass every environment variable as a string, p | |
|
||
```diff | ||
- name: stop script if command error | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -367,7 +367,7 @@ Host FooServer | |
|
||
```diff | ||
- name: ssh proxy command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -390,7 +390,7 @@ It is not uncommon for files to leak from backups or decommissioned hardware, an | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -416,7 +416,7 @@ Now you can adjust you config: | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
* `key_path` - SSH 私钥的路径 | ||
* `fingerprint` - 主机公钥的 SHA256 指纹,默认为跳过验证 | ||
* `script` - 执行命令 | ||
* `script_file` - 執行命令的文件 | ||
* `script_stop` - 当出现第一个错误时停止执行命令 | ||
* `envs` - 传递环境变量到 shell script | ||
* `debug` - 启用调试模式 | ||
|
@@ -58,7 +59,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -157,7 +158,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
|
||
```yaml | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -170,7 +171,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
```yaml | ||
- name: executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -183,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
```yaml | ||
- name: multiple command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -200,7 +201,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: ”foo.com“ | ||
+ host: ”foo.com,bar.com“ | ||
|
@@ -212,11 +213,24 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
ls -al | ||
``` | ||
#### Commands from a file | ||
```yaml | ||
- name: file commands | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
script_path: scripts/script.sh | ||
``` | ||
#### 多个不同端口的主机 | ||
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: ”foo.com“ | ||
+ host: ”foo.com:1234,bar.com:5678“ | ||
|
@@ -231,7 +245,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ”foo.com,bar.com“ | ||
+ sync: true | ||
|
@@ -247,7 +261,7 @@ ssh-keygen -t ed25519 -a 200 -C ”[email protected]“ | |
```diff | ||
- name: pass environment | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
+ env: | ||
+ FOO: ”BAR“ | ||
+ BAR: ”FOO“ | ||
|
@@ -272,7 +286,7 @@ _在 `env` 对象中,您需要将每个环境变量作为字符串传递,传 | |
|
||
```diff | ||
- name: stop script if command error | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -325,7 +339,7 @@ Host FooServer | |
|
||
```diff | ||
- name: ssh proxy command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -346,7 +360,7 @@ Host FooServer | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -372,7 +386,7 @@ ssh example.com ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | cut -d ’ | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
* `key_path` - SSH 私鑰的路徑 | ||
* `fingerprint` - 主機公鑰的 SHA256 指紋,預設為略過驗證 | ||
* `script` - 執行命令 | ||
* `script_file` - 執行命令的文件 | ||
* `script_stop` - 當出現第一個錯誤時停止執行命令 | ||
* `envs` - 傳遞環境變數到 shell script | ||
* `debug` - 啟用偵錯模式 | ||
|
@@ -58,7 +59,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -157,7 +158,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
|
||
```yaml | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -170,7 +171,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```yaml | ||
- name: executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -183,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```yaml | ||
- name: multiple command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -196,11 +197,24 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
![result](./images/output-result.png) | ||
#### Commands from a file | ||
```yaml | ||
- name: file commands | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
script_path: scripts/script.sh | ||
``` | ||
#### 多台主機 | ||
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: "foo.com" | ||
+ host: "foo.com,bar.com" | ||
|
@@ -216,7 +230,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
- host: "foo.com" | ||
+ host: "foo.com:1234,bar.com:5678" | ||
|
@@ -231,7 +245,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```diff | ||
- name: multiple host | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: "foo.com,bar.com" | ||
+ sync: true | ||
|
@@ -247,7 +261,7 @@ ssh-keygen -t ed25519 -a 200 -C "[email protected]" | |
```diff | ||
- name: pass environment | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
+ env: | ||
+ FOO: "BAR" | ||
+ BAR: "FOO" | ||
|
@@ -272,7 +286,7 @@ _在 `env` 對象中,您需要將每個環境變量作為字符串傳遞,傳 | |
|
||
```diff | ||
- name: stop script if command error | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -325,7 +339,7 @@ Host FooServer | |
|
||
```diff | ||
- name: ssh proxy command | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -346,7 +360,7 @@ Host FooServer | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|
@@ -372,7 +386,7 @@ ssh example.com ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | cut -d ' ' | |
|
||
```diff | ||
- name: ssh key passphrase | ||
uses: appleboy/ssh-action@v1.1.0 | ||
uses: appleboy/ssh-action@v1.2.0 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
|