branch-env-vars
branch-env-vars copied to clipboard
Is there a way to support multiline values?
Hi, thanks for creating this action, I have been using it quite successfully in the past months. Today I stumbled on an error when one of the secrets I was interpolating into the values contained newlines. Is there a way to work around this?
jobs:
deploy:
steps:
- name: Set branch-based environment variables
uses: iamtheyammer/[email protected]
with:
WORKING_SEC: |
main:${{ secrets.PRODUCTION_SECRET }}
develop:${{ secrets.DEVELOPMENT_SECRET }}
staging:${{ secrets.STAGING_SECRET }}
NEWLINE_SEC: |
main:${{ secrets.PRODUCTION_SECRET_W_NEWLINE }}
develop:${{ secrets.DEVELOPMENT_SECRET_W_NEWLINE }}
staging:${{ secrets.STAGING_SECRET_W_NEWLINE }}
If the values to the secrets have newlines, eg: secrets.PRODUCTION_SECRET_W_NEWLINE
contains
hello
world
the step will fail with the error message: Error: Invalid value for NEWLINE_SEC: *** does not contain a colon
This is a really interesting edge case. I'll have to fix #11 first, but I'll either make multiline values default or require something like
branch\:multi
line
value
anotherbranch:singlelinevalue
```.
Is there any update on the fix?