2moe/Local SSH Action
Connect using the local ssh and run commands.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stalelast commit Nov 28, 2024
- License
- Apache 2.0
Pinned Snippet
uses: 2moe/local-ssh-action@90f527f39a0263954ea7ba1bf5ef8c06fde8cb16 # v0.0.10tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| log-level | type: enum LogLevel optional values: "trace", "debug", "info", "warn", "error", "off" Default is "info" | no | info |
| pre-local-workdir | The working directory of the local host | no | — |
| pre-local-cmd-async | type: 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-cmd | Execute 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-failure | Type: 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-sleep | Sleep 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-timeout | Since 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-cmd | The 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 |
| host | Remote Server Host | no | — |
| ssh-bin | Local ssh binary file. Default is ssh. In an unstable network environment, you may need to use a specific ssh, not the openssh client. | — | ssh |
| run | Commands to be executed on remote server | yes | — |
| allow-run-failure | Default is false. | no | — |
| post-run | type: string After the main `run` is completed, you can continue to run `post-run` | no | — |
| allow-post-run-failure | Default is true. | — | true |
| args | SSH Client args. You can enter shell arguments for ssh, such as `-q` | no | — |
Outputs
| name | description |
|---|---|
| pre-local-cmd-success | The exit status of `pre-local-cmd`. if ok => true else => false |
| main-run-success | The exit status of `run` |
| post-run-success | The exit status of `post-run` |