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

Unable to use multi-line environment variables #240

Open
bachya opened this issue Mar 27, 2023 · 3 comments
Open

Unable to use multi-line environment variables #240

bachya opened this issue Mar 27, 2023 · 3 comments

Comments

@bachya
Copy link

bachya commented Mar 27, 2023

We have an ECS task into which we've inserted a private key as a multi-line environment variable from a secret store. To retain the newlines, we wrap the environment variable in quotes inside of this actions:

environment-variables: |
  PRIVATE_KEY="{{ secrets.PRIVATE_KEY }}"

Because of how the action parses environment variables (by newlines), it will fail to see this multi-line value as a single variable:

Error: Cannot parse the environment variable '***'. Environment variable pairs must be of the form NAME=value.

Is there a way this scenario can be accommodated?

@dougireton
Copy link

@bachya pretty sure your issue is that GH Actions is masking secrets.PRIVATE_KEY automatically.

@VladPetriv
Copy link

@bachya Did you find a way how to fix it?

@bachya
Copy link
Author

bachya commented Apr 19, 2024

@bachya Did you find a way how to fix it?

I ended up storing my key as a base64-encoded string; then, in my application code, I decode it before I want to use it.

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