2024-01-07 11:39:23 +00:00
|
|
|
name: "SSH Remote Commands"
|
|
|
|
description: "Executing remote ssh commands"
|
|
|
|
author: "Bo-Yi Wu"
|
2019-09-29 02:34:52 +00:00
|
|
|
inputs:
|
|
|
|
host:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SSH host address or IP to connect to."
|
2019-09-29 02:34:52 +00:00
|
|
|
port:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SSH port number for the connection."
|
2023-06-04 03:06:25 +00:00
|
|
|
default: "22"
|
2019-12-30 11:50:55 +00:00
|
|
|
passphrase:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Passphrase to decrypt the SSH private key if protected."
|
2019-09-29 02:34:52 +00:00
|
|
|
username:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SSH username for authentication on the remote server."
|
2019-09-29 02:34:52 +00:00
|
|
|
password:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SSH password for authentication (use secrets for sensitive data)."
|
2024-03-16 07:45:28 +00:00
|
|
|
protocol:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: 'IP protocol version to use. Options: "tcp" (default), "tcp4" (IPv4 only), or "tcp6" (IPv6 only).'
|
2024-03-16 07:45:28 +00:00
|
|
|
default: "tcp"
|
2020-01-30 14:40:33 +00:00
|
|
|
sync:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "When true, executes commands synchronously across multiple hosts (one after another)."
|
2020-05-24 02:54:31 +00:00
|
|
|
use_insecure_cipher:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Enable additional legacy ciphers that might be less secure but more compatible with older systems."
|
2020-05-24 05:13:09 +00:00
|
|
|
cipher:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Specify custom cipher algorithms for encryption. Leave empty to use secure defaults."
|
2019-09-29 02:34:52 +00:00
|
|
|
timeout:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Maximum time to wait when establishing the SSH connection, e.g., '30s', '1m'."
|
2019-09-29 02:34:52 +00:00
|
|
|
default: "30s"
|
|
|
|
command_timeout:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Maximum execution time for the remote commands before terminating, e.g., '10m', '1h'."
|
2019-11-30 15:01:49 +00:00
|
|
|
default: "10m"
|
2019-09-29 02:34:52 +00:00
|
|
|
key:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Raw content of the SSH private key for authentication (use secrets for sensitive data)."
|
2019-09-29 02:34:52 +00:00
|
|
|
key_path:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Path to the SSH private key file on the runner."
|
2020-05-19 06:21:26 +00:00
|
|
|
fingerprint:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SHA256 fingerprint of the host public key for verification to prevent MITM attacks."
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_host:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Proxy server hostname or IP if connecting through an SSH jump host."
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_port:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SSH port number for the proxy connection."
|
2023-06-04 03:06:25 +00:00
|
|
|
default: "22"
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_username:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Username for authentication on the proxy server."
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_password:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Password for authentication on the proxy server (use secrets for sensitive data)."
|
2024-10-28 14:36:36 +00:00
|
|
|
proxy_protocol:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: 'IP protocol version for proxy. Options: "tcp" (default), "tcp4" (IPv4 only), or "tcp6" (IPv6 only).'
|
2024-10-28 14:36:36 +00:00
|
|
|
default: "tcp"
|
2019-12-30 11:50:55 +00:00
|
|
|
proxy_passphrase:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Passphrase to decrypt the proxy SSH private key if protected."
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_timeout:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Maximum time to wait when establishing the proxy SSH connection, e.g., '30s', '1m'."
|
2019-12-07 12:05:02 +00:00
|
|
|
default: "30s"
|
|
|
|
proxy_key:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Raw content of the SSH proxy private key for authentication (use secrets for sensitive data)."
|
2019-12-07 12:05:02 +00:00
|
|
|
proxy_key_path:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Path to the SSH proxy private key file on the runner."
|
2020-05-19 06:21:26 +00:00
|
|
|
proxy_fingerprint:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "SHA256 fingerprint of the proxy host public key for verification."
|
2020-05-24 05:13:09 +00:00
|
|
|
proxy_cipher:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Specify custom cipher algorithms for proxy connection encryption."
|
2020-05-24 02:54:31 +00:00
|
|
|
proxy_use_insecure_cipher:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Enable additional legacy ciphers for proxy connections (less secure but more compatible)."
|
2019-09-29 02:34:52 +00:00
|
|
|
script:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Commands to execute on the remote server (inline script string)."
|
2024-11-17 06:57:46 +00:00
|
|
|
script_path:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Path to a local file containing commands to execute on the remote server."
|
2019-09-29 02:34:52 +00:00
|
|
|
envs:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Environment variables to expose to the remote script, format: key=value,key2=value2."
|
2023-04-13 03:15:42 +00:00
|
|
|
envs_format:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Format specification for environment variable transfer (for advanced usage)."
|
2019-09-29 02:34:52 +00:00
|
|
|
debug:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Set to true to enable verbose logging for troubleshooting connection issues."
|
2023-07-23 01:53:20 +00:00
|
|
|
allenvs:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "When true, passes all GitHub Actions environment variables to the remote script."
|
2024-01-07 11:39:23 +00:00
|
|
|
request_pty:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Request a pseudo-terminal from the server (required for interactive commands or sudo)."
|
2024-12-04 01:49:35 +00:00
|
|
|
capture_stdout:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "When true, captures and returns standard output from the commands as action output."
|
2024-12-04 01:49:35 +00:00
|
|
|
default: "false"
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
stdout:
|
2025-03-09 14:02:08 +00:00
|
|
|
description: "Standard output of the executed commands when capture_stdout is enabled."
|
2024-12-04 01:49:35 +00:00
|
|
|
value: ${{ steps.entrypoint.outputs.stdout }}
|
2024-03-16 07:45:28 +00:00
|
|
|
|
2019-09-29 02:34:52 +00:00
|
|
|
runs:
|
2024-03-16 07:45:28 +00:00
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Set GitHub Path
|
|
|
|
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
2024-12-04 01:49:35 +00:00
|
|
|
- id: entrypoint
|
|
|
|
name: Run entrypoint.sh
|
2024-03-16 07:45:28 +00:00
|
|
|
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 }}
|
2024-11-17 06:57:46 +00:00
|
|
|
INPUT_SCRIPT_FILE: ${{ inputs.script_path }}
|
2024-03-16 07:45:28 +00:00
|
|
|
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 }}
|
2024-12-04 01:49:35 +00:00
|
|
|
INPUT_CAPTURE_STDOUT: ${{ inputs.capture_stdout }}
|
2019-09-29 02:34:52 +00:00
|
|
|
|
|
|
|
branding:
|
2024-01-07 11:39:23 +00:00
|
|
|
icon: "terminal"
|
|
|
|
color: "gray-dark"
|