2moe/Local SSH Action

Connect using the local ssh and run commands.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stalelast commit Nov 28, 2024
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: 2moe/local-ssh-action@90f527f39a0263954ea7ba1bf5ef8c06fde8cb16 # v0.0.10

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
log-leveltype: enum LogLevel optional values: "trace", "debug", "info", "warn", "error", "off" Default is "info" noinfo
pre-local-workdirThe working directory of the local hostno
pre-local-cmd-asynctype: boolean When true, the command is run asynchronously. That is, let the local task run in the background before connecting to the remote ssh. When false, the command is run synchronously (blocking). Before connecting to the remote ssh, you must wait for the pre-local-cmd task to complete. Default is true, i.e., it is asynchronous by default. true
pre-local-cmdExecute the command through NodeJS's `spawn()` or `spawnSync()` before connecting to ssh. This is run on the local host, not the remote host. no
allow-pre-local-cmd-failureType: boolean Default is false When true, ignore the errors of pre-local-cmd. When false, if pre-local-cmd fails, this action will exit abnormally. true
pre-sleepSleep for a specified amount of time before connecting Synchronously (blocking) for a specific time before connecting to ssh, in seconds. typescript type: number rust type: u32 For example, 1, is to block for 1 second. 30, is to block for 30 seconds. P.S. If you need to test whether you can connect normally within a specified time, please use pre-timeout, not pre-sleep. 0
pre-timeoutSince the ssh connection may fail, specifying pre-timeout allows you to wait for a specific time. Unlike the blocking pre-sleep, for pre-timeout, once the test connection is successful, it will exit the wait. typescript type: number rust type: u32 For example, 120, the waiting timeout is 120 seconds. 0
pre-exit-cmdThe command needed to test ssh, default is exit. This option only takes effect when pre-timeout > 0. Suppose `pre-timeout: 30`, `pre-exit-cmd: exit`, `host: openbsd-vm` Then it will keep testing the `ssh openbsd-vm exit` connection within 30 seconds. Only when the test connection is successful, will it proceed to the next stage. (PRE -> MAIN) exit
hostRemote Server Hostno
ssh-binLocal ssh binary file. Default is ssh. In an unstable network environment, you may need to use a specific ssh, not the openssh client. ssh
runCommands to be executed on remote serveryes
allow-run-failureDefault is false.no
post-runtype: string After the main `run` is completed, you can continue to run `post-run` no
allow-post-run-failureDefault is true.true
argsSSH Client args. You can enter shell arguments for ssh, such as `-q`no
namedescription
pre-local-cmd-successThe exit status of `pre-local-cmd`. if ok => true else => false
main-run-successThe exit status of `run`
post-run-successThe exit status of `post-run`