Multi line string not working in run args

It appears that concourse is not recognising multi line strings correctly in a pipeline

WORKS

  run:
    path: sh
    dir: switch
    args:
      - -exc
      -  if [ -n "$(git status -s)" ]; then  git config --global user.email 'concourse@example.com'; git config --global user.name 'Concourse'; git add . && git commit -m 'Auto update from concourse'; fi

Does not WORK

  run:
    path: sh
    dir: switch
    args:
      - -exc
      -  >-
      if [ -n "$(git status -s)" ]; then 
      git config --global user.email 'concourse@example.com';
      git config --global user.name 'Concourse'; 
      git add . && git commit -m 'Auto update from concourse';
      fi

Any ideas ?

I should mention the error when adding the pipeline is error: yaml: could not find expected ‘:’
TIA

Try indenting the multiline string two spaces. i.e.

- >-
  if [ -n "$(git status -s)" ]; then 
  git config --global user.email 'concourse@example.com';
  git config --global user.name 'Concourse'; 
1 Like

The yaml is strong with this one!
Many thanks, and I need to get a linter DOW!

1 Like