Using Environment Variables with period in the name - Not passed to build processes #25573
-
All, An odd behavior. I need to set an environment variable with a period in the name (eframe.key). The action YAML file is:
The variable eframeKey works fine and is in the environment. The eframe.key is not. I am using Micronaut and it seems to need the variable with a period in the name (not sure why yet). I have a short-term work around using a default value in the code, but I need to avoid that for security reasons. Is period just a reserved character for the names? The repository is: https://github.com/simplemes/simplemes-core |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Did you tried using underscore instead of period? |
Beta Was this translation helpful? Give feedback.
-
Hi simplemes, As shafi1996 suggested, when name an environment variable, please use '_ ’ instead of '. ’ . Use eframe_key instead of e frame.key. There is the document for Using environment variables: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. I did try using underscore, but I found a problem with Gradle not passing the env variable to the forked test process. It only seems to pass variables with a period in them :(. I found a work-around with Micronaut using the application-test.yml configuration file. That file provides a value without the need for an environment variable. I will mark this as the answered, just to help other micronaut users. BTW, the link to the doc did not work. I used: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables I could not find anyting saying period (decimal) is not allowed. It is implied that there is some structure to the variable naming scheme. The syntax: jobs.job.env gave me a clue that period might not be supported. Not a big problem, but just for future searchers… |
Beta Was this translation helpful? Give feedback.
Thanks for the feedback. I did try using underscore, but I found a problem with Gradle not passing the env variable to the forked test process. It only seems to pass variables with a period in them :(.
I found a work-around with Micronaut using the application-test.yml configuration file. That file provides a value without the need for an environment variable. I will mark this as the answered, just to help other micronaut users.
BTW, the link to the doc did not work. I used: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables
I could not find anyting saying period (decimal) is not allowed. It is implied that there is some str…