ssh-action/action.yml

138 lines
5.0 KiB
YAML

name: "SSH Remote Commands"
description: "Executing remote ssh commands"
author: "Bo-Yi Wu"
inputs:
host:
description: "SSH host address."
port:
description: "SSH port number."
default: "22"
passphrase:
description: "Passphrase for the SSH key."
username:
description: "SSH username."
password:
description: "SSH password."
protocol:
description: 'The IP protocol to use. Valid values are "tcp". "tcp4" or "tcp6". Default to tcp.'
default: "tcp"
sync:
description: "Enable synchronous execution if multiple hosts are involved."
use_insecure_cipher:
description: "Include more ciphers by using insecure ciphers."
cipher:
description: "Allowed cipher algorithms. If unspecified, a sensible default is used."
timeout:
description: "Timeout duration for establishing SSH connection to the host."
default: "30s"
command_timeout:
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."
key_path:
description: "Path to the SSH private key file."
fingerprint:
description: "SHA256 fingerprint of the host public key."
proxy_host:
description: "SSH proxy host address."
proxy_port:
description: "SSH proxy port number."
default: "22"
proxy_username:
description: "SSH proxy username."
proxy_password:
description: "SSH proxy password."
proxy_protocol:
description: 'The IP protocol to use. Valid values are "tcp". "tcp4" or "tcp6". Default to tcp.'
default: "tcp"
proxy_passphrase:
description: "SSH proxy key passphrase."
proxy_timeout:
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."
proxy_key_path:
description: "Path to the SSH proxy private key file."
proxy_fingerprint:
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."
proxy_use_insecure_cipher:
description: "Include more ciphers for the proxy by using insecure ciphers."
script:
description: "Commands to be executed."
script_path:
description: "Path to the file containing commands to be executed."
envs:
description: "Environment variables to be passed to the shell script."
envs_format:
description: "Flexible configuration for environment value transfer."
debug:
description: "Enable debug mode."
allenvs:
description: "pass all environment variable to shell script."
request_pty:
description: "Request a pseudo-terminal from the server."
capture_stdout:
description: "Capture the stdout of the commands."
default: "false"
outputs:
stdout:
description: 'Standard output of the executed commands.'
value: ${{ steps.entrypoint.outputs.stdout }}
runs:
using: "composite"
steps:
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
- id: entrypoint
name: Run entrypoint.sh
run: entrypoint.sh
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
INPUT_HOST: ${{ inputs.host }}
INPUT_PORT: ${{ inputs.port }}
INPUT_PROTOCOL: ${{ inputs.protocol }}
INPUT_USERNAME: ${{ inputs.username }}
INPUT_PASSWORD: ${{ inputs.password }}
INPUT_PASSPHRASE: ${{ inputs.passphrase }}
INPUT_KEY: ${{ inputs.key }}
INPUT_KEY_PATH: ${{ inputs.key_path }}
INPUT_FINGERPRINT: ${{ inputs.fingerprint }}
INPUT_PROXY_HOST: ${{ inputs.proxy_host }}
INPUT_PROXY_PORT: ${{ inputs.proxy_port }}
INPUT_PROXY_USERNAME: ${{ inputs.proxy_username }}
INPUT_PROXY_PASSWORD: ${{ inputs.proxy_password }}
INPUT_PROXY_PASSPHRASE: ${{ inputs.proxy_passphrase }}
INPUT_PROXY_KEY: ${{ inputs.proxy_key }}
INPUT_PROXY_KEY_PATH: ${{ inputs.proxy_key_path }}
INPUT_PROXY_FINGERPRINT: ${{ inputs.proxy_fingerprint }}
INPUT_TIMEOUT: ${{ inputs.timeout }}
INPUT_PROXY_TIMEOUT: ${{ inputs.proxy_timeout }}
INPUT_COMMAND_TIMEOUT: ${{ inputs.command_timeout }}
INPUT_SCRIPT: ${{ inputs.script }}
INPUT_SCRIPT_FILE: ${{ inputs.script_path }}
INPUT_ENVS: ${{ inputs.envs }}
INPUT_ENVS_FORMAT: ${{ inputs.envs_format }}
INPUT_DEBUG: ${{ inputs.debug }}
INPUT_ALL_ENVS: ${{ inputs.allenvs }}
INPUT_REQUEST_PTY: ${{ inputs.request_pty }}
INPUT_USE_INSECURE_CIPHER: ${{ inputs.use_insecure_cipher }}
INPUT_CIPHER: ${{ inputs.cipher }}
INPUT_PROXY_USE_INSECURE_CIPHER: ${{ inputs.proxy_use_insecure_cipher }}
INPUT_PROXY_CIPHER: ${{ inputs.proxy_cipher }}
INPUT_SYNC: ${{ inputs.sync }}
INPUT_CAPTURE_STDOUT: ${{ inputs.capture_stdout }}
branding:
icon: "terminal"
color: "gray-dark"