Compare commits

..

No commits in common. "9b978f09f2587beff9c80449f57cb0f0612d3039" and "2451745138b602d3e100a6def50c8e4e39591d4c" have entirely different histories.

5 changed files with 62 additions and 86 deletions

View File

@ -261,24 +261,3 @@ jobs:
script_stop: true
script: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
testing05:
name: switch user
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: switch to root user
uses: ./
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script_stop: true
request_pty: true
command_timeout: 30s
script: |
whoami && echo 'hello world' && touch todo.txt
sudo whoami

View File

@ -1,4 +1,4 @@
FROM ghcr.io/appleboy/drone-ssh:1.7.3
FROM ghcr.io/appleboy/drone-ssh:1.7.2
COPY entrypoint.sh /bin/entrypoint.sh

View File

@ -48,7 +48,6 @@ See [action.yml](./action.yml) for more detailed information.
| envs_format | Flexible configuration of environment value transfer | |
| debug | Enable debug mode | false |
| allenvs | Pass all environment variables to shell script | false |
| request_pty | Request a pseudo-terminal from the server | false |
## Usage
@ -64,7 +63,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -165,7 +164,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -178,7 +177,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -191,7 +190,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: multiple command
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -208,7 +207,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
- host: "foo.com"
+ host: "foo.com,bar.com"
@ -224,7 +223,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
- host: "foo.com"
+ host: "foo.com:1234,bar.com:5678"
@ -239,7 +238,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: "foo.com,bar.com"
+ sync: true
@ -255,7 +254,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: pass environment
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
+ env:
+ FOO: "BAR"
+ BAR: "FOO"
@ -280,7 +279,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.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -333,7 +332,7 @@ Host FooServer
```diff
- name: ssh proxy command
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -356,7 +355,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.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -382,7 +381,7 @@ Now you can adjust you config:
```diff
- name: ssh key passphrase
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}

View File

@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -157,7 +157,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -170,7 +170,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -183,7 +183,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml
- name: multiple command
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -200,7 +200,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
- host: "foo.com"
+ host: "foo.com,bar.com"
@ -216,7 +216,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
- host: "foo.com"
+ host: "foo.com:1234,bar.com:5678"
@ -231,7 +231,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: multiple host
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: "foo.com,bar.com"
+ sync: true
@ -247,7 +247,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff
- name: pass environment
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
+ env:
+ FOO: "BAR"
+ BAR: "FOO"
@ -272,7 +272,7 @@ _在 `env` 對象中,您需要將每個環境變量作為字符串傳遞,傳
```diff
- name: stop script if command error
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -325,7 +325,7 @@ Host FooServer
```diff
- name: ssh proxy command
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -346,7 +346,7 @@ Host FooServer
```diff
- name: ssh key passphrase
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@ -372,7 +372,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.0.3
uses: appleboy/ssh-action@v1.0.2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}

View File

@ -1,78 +1,76 @@
name: "SSH Remote Commands"
description: "Executing remote ssh commands"
author: "Bo-Yi Wu"
name: 'SSH Remote Commands'
description: 'Executing remote ssh commands'
author: 'Bo-Yi Wu'
inputs:
host:
description: "SSH host address."
description: 'SSH host address.'
port:
description: "SSH port number."
description: 'SSH port number.'
default: "22"
passphrase:
description: "Passphrase for the SSH key."
description: 'Passphrase for the SSH key.'
username:
description: "SSH username."
description: 'SSH username.'
password:
description: "SSH password."
description: 'SSH password.'
sync:
description: "Enable synchronous execution if multiple hosts are involved."
description: 'Enable synchronous execution if multiple hosts are involved.'
use_insecure_cipher:
description: "Include more ciphers by using insecure ciphers."
description: 'Include more ciphers by using insecure ciphers.'
cipher:
description: "Allowed cipher algorithms. If unspecified, a sensible default is used."
description: 'Allowed cipher algorithms. If unspecified, a sensible default is used.'
timeout:
description: "Timeout duration for establishing SSH connection to the host."
description: 'Timeout duration for establishing SSH connection to the host.'
default: "30s"
command_timeout:
description: "Timeout duration for SSH commands execution."
description: 'Timeout duration for SSH commands execution.'
default: "10m"
key:
description: "Content of the SSH private key. For example, the raw content of ~/.ssh/id_rsa."
description: 'Content of the SSH private key. For example, the raw content of ~/.ssh/id_rsa.'
key_path:
description: "Path to the SSH private key file."
description: 'Path to the SSH private key file.'
fingerprint:
description: "SHA256 fingerprint of the host public key."
description: 'SHA256 fingerprint of the host public key.'
proxy_host:
description: "SSH proxy host address."
description: 'SSH proxy host address.'
proxy_port:
description: "SSH proxy port number."
description: 'SSH proxy port number.'
default: "22"
proxy_username:
description: "SSH proxy username."
description: 'SSH proxy username.'
proxy_password:
description: "SSH proxy password."
description: 'SSH proxy password.'
proxy_passphrase:
description: "SSH proxy key passphrase."
description: 'SSH proxy key passphrase.'
proxy_timeout:
description: "Timeout duration for establishing SSH connection to the proxy host."
description: 'Timeout duration for establishing SSH connection to the proxy host.'
default: "30s"
proxy_key:
description: "Content of the SSH proxy private key. For example, the raw content of ~/.ssh/id_rsa."
description: 'Content of the SSH proxy private key. For example, the raw content of ~/.ssh/id_rsa.'
proxy_key_path:
description: "Path to the SSH proxy private key file."
description: 'Path to the SSH proxy private key file.'
proxy_fingerprint:
description: "SHA256 fingerprint of the proxy host public key."
description: 'SHA256 fingerprint of the proxy host public key.'
proxy_cipher:
description: "Allowed cipher algorithms for the proxy. If unspecified, a sensible default is used."
description: 'Allowed cipher algorithms for the proxy. If unspecified, a sensible default is used.'
proxy_use_insecure_cipher:
description: "Include more ciphers for the proxy by using insecure ciphers."
description: 'Include more ciphers for the proxy by using insecure ciphers.'
script:
description: "Commands to be executed."
description: 'Commands to be executed.'
script_stop:
description: "Stop the script after the first failure."
description: 'Stop the script after the first failure.'
envs:
description: "Environment variables to be passed to the shell script."
description: 'Environment variables to be passed to the shell script.'
envs_format:
description: "Flexible configuration for environment value transfer."
description: 'Flexible configuration for environment value transfer.'
debug:
description: "Enable debug mode."
description: 'Enable debug mode.'
allenvs:
description: "pass all environment variable to shell script."
request_pty:
description: "Request a pseudo-terminal from the server."
description: 'pass all environment variable to shell script.'
runs:
using: "docker"
image: "Dockerfile"
using: 'docker'
image: 'Dockerfile'
branding:
icon: "terminal"
color: "gray-dark"
icon: 'terminal'
color: 'gray-dark'