Fixes an issue with environment variable exports in the doppler-circleci-orb tool, where variables containing $$ (or other values that would be evaluated by the shell environment) were incorrectly evaluated as the process ID when using source .env to import the exports.
Details
This change implements a fix that utilises the built-in @sh filter in jq to escape each value properly and wraps entries in single quotes to prevent evaluation.
Docs for the filter state:
The input is escaped suitable for use in a command-line for a POSIX shell. If the input is an array, the output will be a series of space-separated strings.
Before
# Unexpectedly becomes "secret<Process ID>val" when sourced
export SECRET="secret$$val"
After
# Stays our expected value "secret$$val" when sourced
export SECRET='secret$$val'
Summary
Fixes an issue with environment variable exports in the doppler-circleci-orb tool, where variables containing $$ (or other values that would be evaluated by the shell environment) were incorrectly evaluated as the process ID when using
source .env
to import the exports.Details
This change implements a fix that utilises the built-in @sh filter in jq to escape each value properly and wraps entries in single quotes to prevent evaluation.
Docs for the filter state:
Before
After