Making environment variable defined in .yml workflow available during JVM runtime #5126
Unanswered
mazgajmaciek
asked this question in
General questions
Replies: 1 comment
-
Please see GitHib Workflow to write correct yml (example). Pay attention that yml is sensitive to line breaks and white spaces. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an android app that generates separate builds for each environment we have available - due to that we also have separate test users for each environment (e.g. dev-john, stg-john etc.) so I need to have a way to modify which user is being used for corresponding environment.
I have tried adding env variable in .yml workflow as such:
env: ENVIRONMENT: "dev"
So then based on that variable I would like to retrieve it via something like
System.getProperty()
and select the appropriate user for the environment. Is this doable? When doingprintenv
I can see the ENVIRONMENT variable is getting propagated in GH Actions build log however it only gives menull
when I try to retrieve it in test class with System.getProperty("ENVIRONMENT") during JVN runtime. I also tried usingSystem.getenv("ENVIRONMENT")
since I'm using macos runner but still getting onlynull
at runtime.Beta Was this translation helpful? Give feedback.
All reactions