How to use pipe operator in yml file

1.4k Views Asked by At

I am generating a pipeline.yml file and in the command step, I need to do something like curl google.com | sh but it seems to be interpreted literally.

I tried substituting the command step with shell but it doesn't seem to be supported. What am I missing here?

1

There are 1 best solutions below

0
On

Pipe characters can have special meaning in YAML. Have you tried wrapping the command in quotes to make sure it's a string?

steps:
- command: "curl google.com | sh"