machine:shell:exec
Runs an arbitrary shell command and captures its stdout, stderr and exit code
Options
| Name | Type | Description |
|---|---|---|
dir | string | Working directory for the command; defaults to the pipeline cwd |
command | string | The executable to run |
args | []string | Command-line arguments to pass to the executable |
Outputs
| Name | Type | Description |
|---|---|---|
stdout | string | Standard output captured from the command |
stderr | string | Standard error captured from the command |
code | int | The 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 }}"