Hello,
We’re generating a pipeline which needs to handle an exit code in the middle of a step’s command. We have multiple commands chained and one of them runs puppet, which can exit with code 2 and still mean a successful run.
Example step
{
"label": "puppet",
"command": "sudo puppet agent -t || [[ $? -eq 2 ]] && next-command"
}
When we run the pipeline upload we get this error:
fatal: pipeline interpolation of “(stdin)” failed: interpolating command: Expected identifier to start with a letter, got ?
I’ve tried escaping the $
with \
and $$
(as per some indicated in gh and docs) and neither works.
I also tried \$$
but that’s just mixing things randomly (and ofc doesn’t work).
Do you have any special escaping syntax for this situation? Should I do something differently?
Ideally I don’t want to have to create a script for this step to call.
Thanks for your attention