Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure yaml - line break character support

I have long running lines in my azure devops yaml file such as

condition: and(succeeded(), or(eq(variables['SomeStep.IsScheduledBuild'], 'True'), eq(variables['userOverride.Setting1'], 'yes'), .......))

What is the line break character for such long running conditions so that the yml file conditions such as above can be placed neatly in multiple lines?

Thanks

like image 581
Chubsdad Avatar asked Jan 17 '26 22:01

Chubsdad


1 Answers

What is the line break character

It should be |.

Please refer to below yaml:

- task: CmdLine@2
  condition: |
   and(succeeded(), or(eq(variables['SomeStep.IsScheduledBuild'], 'True'),
   eq(variables['userOverride.Setting1'], 'yes')))
  inputs:
    script: |
      echo Write your commands here
      echo Hello world

Put a | after condition: then you can seperate the expression to multiple lines.

like image 69
mbb5079 Avatar answered Jan 19 '26 19:01

mbb5079