-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Record is not reading env variable set in cypress.json or cypress.env.json #938
Comments
I wouldn't say this was a bug. Usually best practices for secrets are always something done empeherally. |
I added that I also tried: CYPRESS_RECORD_KEY or RECORD_KEY or record_key, which none of them worked |
I understand. We handle the record key different than other environment variables. My question is still from before - this key is secret and sensitive. Why check it into a static file that's version controlled? |
Because the documentation said I could =) no other reason really |
Where does the documentation say that? |
Well, the docs certainly don't say that you can't pass a record key like any other environment variable. It appears like it should work this way (whether it's advisable or not) |
Okay I see the source of confusion - but I'd rather err on the side of not supporting this. It would be easy to do so - but this is a secret key that should not be written alongside of your other environment variables. It would be easy enough for you to choose to embed it somewhere in your I would be open to changing this if a more compelling use case could be justifed. |
https://docs.cypress.io/guides/guides/environment-variables.html#Option-2-cypress-env-json I would like to manage record key in |
Agreed. I would also like to manage it from cypress.env.json and .gitignore it. You shouldn't be checking environment variables into source control almost by definition. If someone has access to reading the contents of your .env file hosted in your environment, them knowing your record key is probably the least of your problems. |
@donaldshen @kfriars Please open a new issue detailing exactly what and why you want this feature request. 2+ yr old issues are not the place to ask for feature requests. |
Current behavior:
Not able to run the
cypress run --record
command without a flag, when storing thekey
as an ENV variableIt works exporting the variable first and then run the
cypress run --record
Desired behavior:
Being able to store env variable
How to reproduce:
{ "projectId": "1280ayu", "env": { "cypress_record_key": "88897382" } }
CYPRESS_RECORD_KEY or RECORD_KEY or record_key
2. run:
cypress run --record
3. Issue occurs: User gets error:
Same thing happens if user tries to store it in:
cypress.env.json
Test code:
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: