buildkite-plugins / monorepo-diff-buildkite-plugin

Run separate pipelines for each folder in your monorepo
MIT License
20 stars 6 forks source link

Escape pipeline interpolation #26

Open sj26 opened 2 days ago

sj26 commented 2 days ago

Currently, when a build message includes a dollar sign ($) and a trigger step is used then it causes an interpolation error:

image

That's because the server side will do interpolation on values in uploaded yaml. So to survive that process any intended literal value should be escaped before upload.

This adds interpolation escaping to the literal values plucked from env to be included in pipeline yaml.

There might still be an issue when client-side interpolation is turned on. In that case the escaping might need to be done twice. But I'm considering that a separate issue.

I have no idea how to run these tests locally. The go tests seem to be broken, and/or require a docker-compose.yml which has been removed. The bats tests seem to need some sort of local load.bash library which I don't have on my system.

Fixes #15.