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

Feature Request: Respect quotes in values #307

Open
Jay-Schneider opened this issue Jul 18, 2024 · 1 comment
Open

Feature Request: Respect quotes in values #307

Jay-Schneider opened this issue Jul 18, 2024 · 1 comment
Assignees

Comments

@Jay-Schneider
Copy link
Member

Current Behaviour

Currently when the content of an .env file parsed with this action looks like this

KEY=value
DIFFERENT_KEY="value"
OTHER_KEY='value'

the exported env variables contain their delimiting quotes. So the content of KEY, DIFFERENT_KEY and OTHER_KEY are not equal.

Expected Behaviour

This is against the convention of .env (or at least some implementations like the ruby dotenv gem).

I often use the above variants, for example I use single quotes to avoid detecting $ as the start of another ENV variable for example in API_KEY='$ecret'. This now gets parsed differently by dotenv (which yields the string $ecret) and this action (which yields the string with content '$ecret').

Another example happened recently, when we wanted to define a string with trailing spaces like this

SOME_SEPARATOR=" – "

which is parsed as " – " by this action while dotenv parses what we meant: .

Note: This case does not only have problems with the quote parsing but would also fail otherwise because the action trims whitespace from the parsed values. But that's a different issue.

For us, this resulted in unexpected failing of the CI pipeline, where we used the global-variables action to populate the ENV globally with the content of our .env.test before running any rails command (which prevents the dotenv gem to read the respective variables again). This made the CI behave differntly than running the tests locally.

@kevinkupski
Copy link
Member

@stefanvocke could you have a look at this when you have time?

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

No branches or pull requests

3 participants