Symptoms
You are attempting to run a multi-line inline "if" command, but it is not processing correctly.
Cause
Multiline formatting must follow specific syntax.
Solution
We suggest that you instead include the script as a file to be downloaded as part of your Clone step, or an additional step.
If those options are not available, note:
- Do not use indentation deeper than your first command.
- Add semi-colons at the appropriate spots.
test:
title: "Running test"
image: "ubuntu:latest"
commands:
- >-
if [ ${{VAR}} -eq 42 ];
then
echo "true";
else
echo "false";
fi
- You can concatenate everything onto one line.
Notes We strongly suggest making use of script files where possible. This aids with GitOps and allows easier configuration changes.
Read more
Stack Overflow: How do I break a string over multiple lines?