Skip to content

Echo Script

echo-script runs a script through bash, so the script file itself does not need the execute bit. It is one of the bundled functions you can use from a button as it is.

  • Runs: bash {{.path}}{{if .args}} {{.args}}{{end}}
  • path (required): path to the script file
  • args (optional): extra arguments

The function file

functions/echo-script.yaml
name: echo-script
run: "bash {{.path}}{{if .args}} {{.args}}{{end}}"
params:
  - name: path
    type: string
    required: true
    description: Path to the script file
  - name: args
    type: string
    required: false
    description: Optional script arguments

Write both parameter names directly on the button.

Run a script through Bash

Run cleanup button
- name: Run cleanup
  type: button
  function: echo-script
  path: "/opt/scripts/cleanup.sh"
  args: "--verbose"

That button runs bash /opt/scripts/cleanup.sh --verbose. Leave args out and it runs bash /opt/scripts/cleanup.sh, because the {{if .args}} part is skipped when the value is empty.