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

Do not use DotEnv store for exec-env, but specialized environment serializing code #1436

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felixfontein
Copy link
Contributor

Fixes #784.

While looking at this I noticed that the DotEnv store does quite a few things that are bad, like assuming that all map keys are strings that do not contain =, and that values are strings if they aren't complex. The code I added for environment serialization takes care of these issues, but the DotEnv code itself should also do that.

Some of the DotEnv problems are fixed by #1401, so I didn't want to start changing that code as well.

This avoids quoting problems, fixes getsops#784, and also better handles
various problems that can arise, like '=' in keys and non-string
keys and values.

Signed-off-by: Felix Fontein <[email protected]>
@felixfontein
Copy link
Contributor Author

Looks like I forgot to actually commit my latest changes yesterday 🤦 I've updated the PR.

@cpdeethree
Copy link

Does this also apply to exec-file as well? Was struggling with this when trying to load an encrypted file into GITHUB_ENV and curious if this will also fix that.

@felixfontein
Copy link
Contributor Author

felixfontein commented Feb 12, 2024

exec-file does not put secrets into environment variables, so no. I guess you are talking about the dotenv output format, which isn't affected by this PR.

@cpdeethree
Copy link

exec-file does not put secrets into environment variables, so no. I guess you are talking about the dotenv output format, which isn't affected by this PR.

Makes sense, thank you!

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.

Bug when decoding multi-line content in exec-env
2 participants