8 Commits

Author SHA1 Message Date
029f5b4aee docs: update README.md and improve code documentation
Some checks failed
remote ssh command / default flag testing (push) Failing after 5s
remote ssh command / testing with envs (push) Failing after 4s
remote ssh command / git clone and pull (push) Failing after 3s
remote ssh command / docker login and pull (push) Failing after 10s
remote ssh command / switch user (push) Failing after 7s
- Add a new entry for `request_pty` in the README.md file

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-07 19:40:43 +08:00
d134a26a1f fix(sudo): support request_pty to execute sudo command (#288)
- Add a new job called `testing05` to the CI workflow
- Update the base image in the Dockerfile from `1.7.2` to `1.7.3`
- Update the action name, description, and author in the action.yml file
- Update the descriptions for various inputs in the action.yml file
- Add a new input `request_pty` with a description in the action.yml file
- Update the `using` and `image` fields in the action.yml file
- Update the `using` and `image` fields in the runs section of the action.yml file
- Update the `icon` and `color` fields in the branding section of the action.yml file

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-07 19:39:23 +08:00
2451745138 chore: update SSH action version in README files
Some checks failed
remote ssh command / default flag testing (push) Failing after 5s
remote ssh command / testing with envs (push) Failing after 3s
remote ssh command / git clone and pull (push) Failing after 5s
remote ssh command / docker login and pull (push) Failing after 4s
- Update the version of the `appleboy/ssh-action` to `v1.0.2` in the `README.md` and `README.zh-tw.md` files.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-01 14:23:27 +08:00
1f3c338936 chore: update base image to 1.7.2 in Dockerfile
- Update the base image from `1.7.1` to `1.7.2` in the Dockerfile

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-01 14:22:41 +08:00
8f94919856 chore: update appleboy/ssh-action to v1.0.1 in documentation
Some checks failed
remote ssh command / default flag testing (push) Failing after 5s
remote ssh command / testing with envs (push) Failing after 4s
remote ssh command / git clone and pull (push) Failing after 4s
remote ssh command / docker login and pull (push) Failing after 4s
- Update appleboy/ssh-action from v1.0.0 to v1.0.1 in README.md
- Update appleboy/ssh-action from v0.1.10 to v1.0.1 in README.zh-tw.md

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-26 15:13:15 +08:00
2344d97573 chore(security): update drone-ssh to v1.7.1 (#286)
- Update the base image in Dockerfile from `1.7.0` to `1.7.1`
- Change the location of `entrypoint.sh` from root to `/bin/` directory in Dockerfile
- Remove the explicit `chmod +x` command for `entrypoint.sh` in Dockerfile

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-26 15:11:53 +08:00
b9f6bf6223 style: refine CI Workflow and Test Configurations
- Remove empty lines from the GitHub Actions CI workflow file

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-26 15:07:39 +08:00
4330a1ea48 docs: update appleboy/ssh-action version in README
- Update the version of `appleboy/ssh-action` from `v0.2.0` to `v1.0.0` in multiple places in the README.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-07-23 10:05:56 +08:00
5 changed files with 292 additions and 270 deletions

View File

@ -6,129 +6,128 @@ env:
BAR: "FOO" BAR: "FOO"
jobs: jobs:
testing01: testing01:
name: default flag testing name: default flag testing
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: correct password but wrong key - name: correct password but wrong key
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
key: "1234" key: "1234"
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: whoami script: whoami
- name: wrong password but correct key - name: wrong password but correct key
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: "abcdef" password: "abcdef"
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: whoami script: whoami
- name: executing remote ssh commands using password - name: executing remote ssh commands using password
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: whoami script: whoami
- name: executing remote ssh commands using ssh key - name: executing remote ssh commands using ssh key
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: whoami script: whoami
- name: multiple command - name: multiple command
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: | script: |
whoami whoami
ls -al ls -al
- name: stop script if command error - name: stop script if command error
uses: ./ uses: ./
continue-on-error: true continue-on-error: true
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script_stop: true script_stop: true
sync: true sync: true
debug: true debug: true
script: | script: |
mkdir abc/def mkdir abc/def
ls -al ls -al
- name: ssh key passphrase - name: ssh key passphrase
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH2 }} key: ${{ secrets.SSH2 }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
passphrase: ${{ secrets.PASSPHRASE }} passphrase: ${{ secrets.PASSPHRASE }}
script: | script: |
whoami whoami
ls -al ls -al
- name: use insecure cipher - name: use insecure cipher
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script: | script: |
ls \ ls \
-lah -lah
use_insecure_cipher: true use_insecure_cipher: true
# https://github.com/appleboy/ssh-action/issues/75#issuecomment-668314271 # https://github.com/appleboy/ssh-action/issues/75#issuecomment-668314271
- name: Multiline SSH commands interpreted as single lines - name: Multiline SSH commands interpreted as single lines
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script_stop: true script_stop: true
script: | script: |
ls \ ls \
-lah -lah
use_insecure_cipher: true use_insecure_cipher: true
# https://github.com/appleboy/ssh-action/issues/85 # https://github.com/appleboy/ssh-action/issues/85
- name: Deployment to multiple hosts with different ports - name: Deployment to multiple hosts with different ports
uses: ./ uses: ./
with: with:
host: "${{ secrets.HOST }}:${{ secrets.PORT }}" host: "${{ secrets.HOST }}:${{ secrets.PORT }}"
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
port: 1024 port: 1024
script_stop: true script_stop: true
script: | script: |
ls \ ls \
-lah -lah
use_insecure_cipher: true use_insecure_cipher: true
# - name: SSH ED25519 Private Key # - name: SSH ED25519 Private Key
# uses: ./ # uses: ./
@ -143,123 +142,143 @@ jobs:
name: testing with envs name: testing with envs
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: pass environment - name: pass environment
uses: ./ uses: ./
env: env:
FOO: "BAR" FOO: "BAR"
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
envs: FOO envs: FOO
script: | script: |
echo "I am $FOO, thanks" echo "I am $FOO, thanks"
echo "I am $BAR, thanks" echo "I am $BAR, thanks"
- name: pass multiple environment - name: pass multiple environment
uses: ./ uses: ./
env: env:
FOO: "BAR" FOO: "BAR"
BAR: "FOO" BAR: "FOO"
SHA: ${{ github.sha }} SHA: ${{ github.sha }}
PORT: ${{ secrets.PORT }} PORT: ${{ secrets.PORT }}
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
envs: FOO,BAR,SHA,PORT envs: FOO,BAR,SHA,PORT
script: | script: |
echo "I am $FOO, thanks" echo "I am $FOO, thanks"
echo "I am $BAR, thanks" echo "I am $BAR, thanks"
echo "sha: $SHA" echo "sha: $SHA"
echo "port: $PORT" echo "port: $PORT"
sh test.sh sh test.sh
- name: custom envs format - name: custom envs format
uses: ./ uses: ./
env: env:
FOO: "BAR" FOO: "BAR"
AAA: "BBB" AAA: "BBB"
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
envs: FOO,BAR,AAA envs: FOO,BAR,AAA
envs_format: export TEST_{NAME}={VALUE} envs_format: export TEST_{NAME}={VALUE}
script: | script: |
echo "I am $TEST_FOO, thanks" echo "I am $TEST_FOO, thanks"
echo "I am $TEST_BAR, thanks" echo "I am $TEST_BAR, thanks"
echo "I am $BAR, thanks" echo "I am $BAR, thanks"
echo "I am $TEST_AAA, thanks" echo "I am $TEST_AAA, thanks"
- name: pass all ENV variables to script - name: pass all ENV variables to script
uses: ./ uses: ./
env: env:
INPUT_FOO: "BAR" INPUT_FOO: "BAR"
INPUT_AAA: "BBB" INPUT_AAA: "BBB"
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
allenvs: true allenvs: true
script: | script: |
echo "I am $INPUT_FOO, thanks" echo "I am $INPUT_FOO, thanks"
echo "I am $INPUT_AAA, thanks" echo "I am $INPUT_AAA, thanks"
echo "$GITHUB_BASE_REF" echo "$GITHUB_BASE_REF"
echo "$GITHUB_REF" echo "$GITHUB_REF"
testing03: testing03:
name: git clone and pull name: git clone and pull
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: clone private repository - name: clone private repository
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script_stop: true script_stop: true
script: | script: |
git clone https://appleboy:${{ secrets.TEST_TOKEN }}@github.com/go-training/self-runner.git test_repository git clone https://appleboy:${{ secrets.TEST_TOKEN }}@github.com/go-training/self-runner.git test_repository
rm -rf test_repository rm -rf test_repository
testing04: testing04:
name: docker login and pull name: docker login and pull
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: login GitHub Container Registry - name: login GitHub Container Registry
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script_stop: true script_stop: true
script: | script: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u github.actor --password-stdin echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u github.actor --password-stdin
- name: login DockerHub Container Registry - name: login DockerHub Container Registry
uses: ./ uses: ./
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }} port: ${{ secrets.PORT }}
script_stop: true script_stop: true
script: | script: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin 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,5 +1,5 @@
FROM ghcr.io/appleboy/drone-ssh:1.7.0 FROM ghcr.io/appleboy/drone-ssh:1.7.3
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/bin/entrypoint.sh"]

View File

@ -48,6 +48,7 @@ See [action.yml](./action.yml) for more detailed information.
| 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 all environment variables to shell script | false | | allenvs | Pass all environment variables to shell script | false |
| request_pty | Request a pseudo-terminal from the server | false |
## Usage ## Usage
@ -63,7 +64,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: executing remote ssh commands using password - name: executing remote ssh commands using password
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -164,7 +165,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml ```yaml
- name: executing remote ssh commands using password - name: executing remote ssh commands using password
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -177,7 +178,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml ```yaml
- name: executing remote ssh commands using ssh key - name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -190,7 +191,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```yaml ```yaml
- name: multiple command - name: multiple command
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -207,7 +208,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff ```diff
- name: multiple host - name: multiple host
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
- host: "foo.com" - host: "foo.com"
+ host: "foo.com,bar.com" + host: "foo.com,bar.com"
@ -223,7 +224,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff ```diff
- name: multiple host - name: multiple host
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
- host: "foo.com" - host: "foo.com"
+ host: "foo.com:1234,bar.com:5678" + host: "foo.com:1234,bar.com:5678"
@ -238,7 +239,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff ```diff
- name: multiple host - name: multiple host
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: "foo.com,bar.com" host: "foo.com,bar.com"
+ sync: true + sync: true
@ -254,7 +255,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
```diff ```diff
- name: pass environment - name: pass environment
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
+ env: + env:
+ FOO: "BAR" + FOO: "BAR"
+ BAR: "FOO" + BAR: "FOO"
@ -279,7 +280,7 @@ _Inside `env` object, you need to pass every environment variable as a string, p
```diff ```diff
- name: stop script if command error - name: stop script if command error
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -332,7 +333,7 @@ Host FooServer
```diff ```diff
- name: ssh proxy command - name: ssh proxy command
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -355,7 +356,7 @@ It is not uncommon for files to leak from backups or decommissioned hardware, an
```diff ```diff
- name: ssh key passphrase - name: ssh key passphrase
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
@ -381,7 +382,7 @@ Now you can adjust you config:
```diff ```diff
- name: ssh key passphrase - name: ssh key passphrase
uses: appleboy/ssh-action@v0.2.0 uses: appleboy/ssh-action@v1.0.2
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}

View File

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

View File

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