Drone is automatically adding quotes during interpolation when the secret is a multi-line content/value. This automatic quoting messes up use-cases where additional text might need to be included during interprolation. For example,
VALUE="${SENTINEL}\n${MY_SECRET}\n${SENTINEL}"
The interpolation should be smart/context aware that is already in quote and not add quotes.
In fact, If the value happens to be multi-line, the YAML should have it in quotes. Otherwise it should result in parsing error. That is my feedback.
Instead of concatenating three secrets at runtime:
VALUE="${SENTINEL}\n${MY_SECRET}\n${SENTINEL}"
The recommended approach is to use a single secret that represents the concatenated version of the string.
VALUE="${MY_SECRER_WITH_SENTINAL}"
The interpolation should be smart/context aware that is already in quote and not add quotes.
If you feel strongly about this send a pull request https://github.com/drone/envsubst. This is not something I’m planning to work on, so outside contribution would be required.
In fact, If the value happens to be multi-line, the YAML should have it in quotes. Otherwise it should result in parsing error. That is my feedback.
this sounds like a good proposal until you have 10 people a day asking you why multi-line secrets cause the yaml to fail. This is what happened in 0.4. So while I respect your opinion, it is without context or experience in broad, real world usage and support implications.