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

Add option to skip shell escaping #66

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

Add option to skip shell escaping #66

wants to merge 1 commit into from

Conversation

c-w
Copy link

@c-w c-w commented Dec 18, 2023

This pull request adds a flag --raw to skip shell escaping the values that are being output. The use-case I have for this flag is two-fold:

  1. The current escaping is quite aggressive and adds quotes in scenarios where they're not strictly necessary (e.g. export FOO=bar+baz works fine but currently gets escaped); adding this flag means more predictable output in scenarios where the user knows that the secrets won't contain any shell-specific special characters.

  2. More importantly adding this flag means that ejson2env can now be used on Github Actions to set environment variables (docs) via ejson2env --raw path/to/secrets.ejson >> "${GITHUB_ENV}". Before this PR, this approach wouldn't work as Github Actions doesn't interpret escape characters.

@c-w c-w requested a review from burke as a code owner December 18, 2023 14:57
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.

1 participant