Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variables separation logic #10

Merged
merged 1 commit into from
Aug 20, 2020
Merged

Environment Variables separation logic #10

merged 1 commit into from
Aug 20, 2020

Conversation

yuhattor
Copy link
Contributor

I had a secret like "foobarbaz123=" and tried to use it with this aci-create-action. But after I deployed an application on container, I noticed that the last '=' part of my variable was lost because of the logic below.

let pairList = pair.split('=');

The logic has to split string only on first instance of '='.

@shubham1172
Copy link
Member

Hey, what if my secret contains a space? If I want to parse key="this is a value" key2=another, the current logic fails because of splitting on space. I think we can use a regex like this one /(?:[^\s"]+|"[^"]*")+/g to split on space only if it is not wrapped inside double-quotes.

For example,

'key="this is a value" key2=another'.match(/(?:[^\s"]+|"[^"]*")+/g)
>> Array [ "key=\"this is a value\"", "key2=another" ]

This change would make the parsing robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants