Compare commits

..

No commits in common. "a9e2fdf08d46817c815611f3989f7757048795bd" and "8fdfeb034ef6e9033a8a4407975aedbc12a08737" have entirely different histories.

3 changed files with 48 additions and 51 deletions

View File

@ -3,13 +3,15 @@
[繁體中文](./README.zh-tw.md) [繁體中文](./README.zh-tw.md)
[简体中文](./README.zh-cn.md) [简体中文](./README.zh-cn.md)
[GitHub Action](https://github.com/features/actions) for executing remote SSH commands. [GitHub Action](https://github.com/features/actions) for executing remote ssh commands.
![ssh workflow](./images/ssh-workflow.png) ![ssh workflow](./images/ssh-workflow.png)
[![testing main branch](https://github.com/appleboy/ssh-action/actions/workflows/main.yml/badge.svg)](https://github.com/appleboy/ssh-action/actions/workflows/main.yml) [![Actions Status](https://github.com/appleboy/ssh-action/workflows/remote%20ssh%20command/badge.svg)](https://github.com/appleboy/ssh-action/actions)
This project is built using [Golang](https://go.dev) and [drone-ssh](https://github.com/appleboy/drone-ssh). 🚀 **Important**: Only support **Linux** [docker](https://www.docker.com/) container.
This thing is built using [Golang](https://go.dev) and [drone-ssh](https://github.com/appleboy/drone-ssh). 🚀
## Input variables ## Input variables
@ -49,12 +51,12 @@ See [action.yml](./action.yml) for more detailed information.
| envs | Pass environment variables to shell script | | | envs | Pass environment variables to shell script | |
| envs_format | Flexible configuration of environment value transfer | | | envs_format | Flexible configuration of environment value transfer | |
| debug | Enable debug mode | false | | debug | Enable debug mode | false |
| allenvs | Pass the environment variables with prefix value of `GITHUB_` and `INPUT_` to the script | false | | allenvs | pass the environment variables with prefix value of `GITHUB_` and `INPUT_` to the script | false |
| request_pty | Request a pseudo-terminal from the server | false | | request_pty | Request a pseudo-terminal from the server | false |
## Usage ## Usage
Executing remote SSH commands. Executing remote ssh commands.
```yaml ```yaml
name: remote ssh command name: remote ssh command

View File

@ -4,7 +4,9 @@
![ssh workflow](./images/ssh-workflow.png) ![ssh workflow](./images/ssh-workflow.png)
[![testing main branch](https://github.com/appleboy/ssh-action/actions/workflows/main.yml/badge.svg)](https://github.com/appleboy/ssh-action/actions/workflows/main.yml) [![Actions Status](https://github.com/appleboy/ssh-action/workflows/remote%20ssh%20command/badge.svg)](https://github.com/appleboy/ssh-action/actions)
**注意** 只支持在 **Linux** [docker](https://www.docker.com/) 容器上执行。
## 输入变量 ## 输入变量

View File

@ -1,58 +1,51 @@
# 🚀 GitHub Actions 的 SSH # 🚀 用於 GitHub Actions 的 SSH
[English](./README.md) [GitHub Action](https://github.com/features/actions) for executing remote ssh commands.
[简体中文](./README.zh-cn.md)
[GitHub Action](https://github.com/features/actions) 用於執行遠端 SSH 命令。
![ssh workflow](./images/ssh-workflow.png) ![ssh workflow](./images/ssh-workflow.png)
[![testing main branch](https://github.com/appleboy/ssh-action/actions/workflows/main.yml/badge.svg)](https://github.com/appleboy/ssh-action/actions/workflows/main.yml) [![Actions Status](https://github.com/appleboy/ssh-action/workflows/remote%20ssh%20command/badge.svg)](https://github.com/appleboy/ssh-action/actions)
此專案使用 [Golang](https://go.dev) 和 [drone-ssh](https://github.com/appleboy/drone-ssh) 建立。🚀 **注意** 只支援在 **Linux** [docker](https://www.docker.com/) 容器上執行。
## 輸入變數 ## 輸入變數
請參閱 [action.yml](./action.yml) 以獲取更詳細的信息 更詳細的資訊,請參閱 [action.yml](./action.yml)。
| 輸入參數 | 描述 | 預設值 | * `host` - SSH 主機
| ------------------------- | ----------------------------------------------------- | ------ | * `port` - SSH 連接埠,預設為 `22`
| host | SSH 主機地址 | | * `username` - SSH 使用者名稱
| port | SSH 埠號 | 22 | * `password` - SSH 密碼
| passphrase | SSH 金鑰密碼 | | * `passphrase` - 通常用於加密私鑰的 passphrase
| username | SSH 使用者名稱 | | * `sync` - 同步執行多個主機上的命令,預設為 false
| password | SSH 密碼 | | * `timeout` - SSH 連接到遠端主機的超時時間,預設為 `30s`
| protocol | SSH 協議版本 (tcp, tcp4, tcp6) | tcp | * `command_timeout` - SSH 命令超時時間,預設為 10m
| sync | 如果有多個主機,啟用同步執行 | false | * `key` - SSH 私鑰的內容,例如 ~/.ssh/id_rsa 的原始內容,請記得包含 BEGIN 和 END 行
| use_insecure_cipher | 包含更多不安全的加密算法 | false | * `key_path` - SSH 私鑰的路徑
| cipher | 允許的加密算法。如果未指定,則使用合理的預設值 | | * `fingerprint` - 主機公鑰的 SHA256 指紋,預設為略過驗證
| timeout | SSH 連接主機的超時時間 | 30s | * `script` - 執行命令
| command_timeout | SSH 命令的超時時間 | 10m | * `script_file` - 執行命令的文件
| key | SSH 私鑰的內容。例如,~/.ssh/id_rsa 的原始內容 | | * `script_stop` - 當出現第一個錯誤時停止執行命令
| key_path | SSH 私鑰的路徑 | | * `envs` - 傳遞環境變數到 shell script
| fingerprint | 主機公鑰的 SHA256 指紋 | | * `debug` - 啟用偵錯模式
| proxy_host | SSH 代理主機 | | * `use_insecure_cipher` - 使用不安全的密碼ciphers進行加密參見 [#56](https://github.com/appleboy/ssh-action/issues/56)
| proxy_port | SSH 代理埠號 | 22 | * `cipher` - 允許使用的密碼ciphers演算法。如果未指定則使用適當的演算法
| proxy_protocol | SSH 代理協議版本 (tcp, tcp4, tcp6) | tcp |
| proxy_username | SSH 代理使用者名稱 | |
| proxy_password | SSH 代理密碼 | |
| proxy_passphrase | SSH 代理金鑰密碼 | |
| proxy_timeout | SSH 連接代理主機的超時時間 | 30s |
| proxy_key | SSH 代理私鑰的內容 | |
| proxy_key_path | SSH 代理私鑰的路徑 | |
| proxy_fingerprint | 代理主機公鑰的 SHA256 指紋 | |
| proxy_cipher | 代理允許的加密算法 | |
| proxy_use_insecure_cipher | 包含更多不安全的加密算法 | false |
| script | 執行命令 | |
| script_file | 從文件中執行命令 | |
| script_stop | 在第一次失敗後停止腳本 | false |
| envs | 將環境變數傳遞給 shell 腳本 | |
| envs_format | 環境值傳遞的靈活配置 | |
| debug | 啟用調試模式 | false |
| allenvs | 將帶有 `GITHUB_``INPUT_` 前綴的環境變數傳遞給腳本 | false |
| request_pty | 從伺服器請求偽終端 | false |
## 用法 SSH 代理設置:
* `proxy_host` - 代理主機
* `proxy_port` - 代理端口,預設為 `22`
* `proxy_username` - 代理使用者名稱
* `proxy_password` - 代理密碼
* `proxy_passphrase` - 密碼通常用於加密私有金鑰
* `proxy_timeout` - SSH 連線至代理主機的逾時時間,預設為 `30s`
* `proxy_key` - SSH 代理私有金鑰內容
* `proxy_key_path` - SSH 代理私有金鑰路徑
* `proxy_fingerprint` - 代理主機公鑰的 SHA256 指紋,預設為跳過驗證
* `proxy_use_insecure_cipher` - 使用不安全的加密方式,請參閱 [#56](https://github.com/appleboy/ssh-action/issues/56)
* `proxy_cipher` - 允許的加密算法。如果未指定,則使用合理的算法
## 使用方式
執行遠端 SSH 命令 執行遠端 SSH 命令