Skip to content

env vars with commas in value do not work #495

@brianzinn

Description

@brianzinn

TL;DR

Unable to include environment variables with commas

Expected behavior

I was expecting the commas to be allowed. A delimiter would be introduced based on the input or otherwise we could supply one.

Observed behavior

The commas cause the environment to be split out - using parts of the values as keys for new entries.

Action YAML

id: 'deploy'
   uses: 'google-github-actions/[email protected]'
   with:
          service: 'my-name'
          image: 'us.gcr.io/my-image'
          region: 'my-region'
          # these values are actually from github variables
          env_vars: |
            EMAIL_ADDRESSES=name 1 <[email protected]>,name 2 <[email protected]>,name 3 <[email protected]>
            VAR2=test

Log output

gcloud run deploy ... \
   --update-env-vars EMAIL_ADDRESSES=name 1 <[email protected]>,name 2 <[email protected]>=,name 3 <[email protected]>=,VAR2=TEST

Additional information

see #469 the environment values are being split out and new keys are being created from the values.
https://cloud.google.com/workflows/docs/use-environment-variables#set_multiple_environment_variables
That PR that was not merged I was suspecting would convert to:
gcloud run deploy ...
--set-env-vars ^@^KEY1=VALUE1,VALUE2,VALUE3@KEY2=VALUE2

So, if we were able to provide the delimiter as per the PR then it would be possible to have commas in the values? Otherwise if you are using a non-comma delimiter then you need to change how you are sending it...

I was unable to provide a full example since I have a lot of variables, so hopefully that makes a clean repro on your side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions