DocsWorkflowsComponentsMachinemachine:shell:exec

machine:shell:exec

Runs an arbitrary shell command and captures its stdout, stderr and exit code

Options

NameTypeDescription
dirstringWorking directory for the command; defaults to the pipeline cwd
commandstringThe executable to run
args[]stringCommand-line arguments to pass to the executable

Outputs

NameTypeDescription
stdoutstringStandard output captured from the command
stderrstringStandard error captured from the command
codeintThe process exit code

Example

name: Read the current commit
actions:
  - name: commit
    component: machine:shell:exec
    vars:
      dir: ./project
      command: git
      args:
        - rev-parse
        - HEAD

outputs:
  commit: "{{ commit.stdout }}"