Run shell script

Use Run shell script (shell.run) to run a multi-line script in the workflow runtime or on a remote SSH host. The same environment, standard input, structured input, files and workspace secrets are delivered on every execution target.

{{ }} templates in the script resolve before it runs, and an unresolvable one fails the step. Foreign template syntax passes through as written: ${{ … }} (GitHub Actions) and leading-dot variables such as {{ .Values.x }} (Helm, Go). To emit any other literal {{ … }}, escape the braces: \{\{ var \}\} renders {{ var }}.

The default time limit is 30 minutes.

Execution target

Run on has 3 states:

Run on Where the script runs
Workflow default (unset) Follows the workflow's Run on setting (Settings › Environment), which is Rollout unless changed
Rollout The workflow's native, Docker or Kubernetes runtime
Remote (SSH) The SSH host you set, through a connectivity service on hosted Rollout

Destination. The SSH destination comes from exactly one source. A step that names its own Host or SSH key uses its own Remote settings. A step that names neither uses the workflow's Remote destination as a whole. The two are never mixed, so a step's default port can't change the workflow's destination, and a workflow key is never paired with a host the step chose.

Connectivity service. Bind a connectivity service such as Tailscale to carry SSH to a private network. On hosted Rollout, Remote (SSH) needs one for every host, public ones included, and without it the step fails with capability_denied. A self-hosted installation can connect directly unless its operator turned that off.

With a service bound, the step runs in a container, so its image needs an ssh client and a SOCKS-capable nc. Set it in Runtime image on the step or the workflow, or the installation's default SSH step image applies.

While that transport warms up, an inert connection probe retries on SSH exit 255, up to 8 attempts, 4 seconds apart. The script itself runs once: its own non-zero exit is never replayed by the transport.

Secrets. Workspace secrets are resolved at step start on both targets, override plain environment values with the same name, and are registered for log redaction. Environment names must match ^[A-Za-z_][A-Za-z0-9_]*$.

A sensitive value. A step whose stdin, input or files take a value an Act in browser step held as sensitive runs only on Remote (SSH): directly, or through a connectivity service on Kubernetes. Anywhere else it fails before it runs, with sensitive_input_refused. A sensitive value can't go to its env or its script, and the host and its script see the value as it is. See Security.

Inputs

Input Type Description
env object Plain environment variables. Declared workspace secrets override matching keys
workdir string Working directory in the runtime, or the path on the SSH host
stdin string Text delivered to the script's standard input
input any JSON-encoded into the file named by $ROLLOUT_INPUT_FILE
files list Files placed below workdir before the script starts

Each files entry has a relative path and exactly one source:

[
  {"path": "config/app.json", "content": "{\"enabled\":true}"},
  {"path": "assets/logo.png", "attachment_ref": {"id": "..."}}
]

Absolute paths, traversal (..), duplicate normalized paths, missing sources and entries with both sources are rejected. Attachment references resolve inside the current workspace. Docker and Kubernetes stage the payload under /rollout. SSH sends it as framed bytes on the command's single channel and extracts a tar archive below the remote workdir.

On Kubernetes, the rendered script, JSON input, stdin, files and secret values share one ephemeral Secret. Their combined payload must not exceed 1 MiB, and an oversized step fails before pod creation with input_too_large. The script is mounted as /rollout/step.sh, so the container argv limit doesn't constrain its size.

Outputs

The step returns stdout, stderr and exit_code. The native runtime merges both streams into stdout and leaves stderr empty, so a declared output with source stderr reads nothing there. By default a non-zero exit fails the step with command_failed, and the outputs stay visible on the failed step. Turn on Continue on error to treat exit_code as data and keep going.

Capture Files collects selected workspace paths into the files output on runtimes with a shared workspace. It isn't available for remote SSH paths.

A stream kept as a log holds only its trailing 64 KiB, a little less when a run secret sits on the cut: the cut moves past the whole secret so it can still be redacted. A stream a declared output reads arrives whole, up to 1 MiB, and a larger one fails with output_too_large.

Use Inputs and outputs to parse or project structured values. For example, a strict JSON stdout output is:

{
  "io": {
    "outputs": [
      {"id": "json", "source": "stdout", "parse": "json", "policy": "strict"}
    ]
  }
}

A declared output named warnings with policy warn also fills the run's warning channel. Warning strings are redacted before the 50-item, 1 KiB-per-item display cap.

Output parsing is declared through io.outputs. Execution doesn't infer a parser from stdout or repair undeclared settings.