Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

pass env vars to all actions

ursboller
Community Advisor
Community Advisor

I have some .env variables I want to pass to all actions. Until now, I added the variables in question as params to all actions in the manifest.yml file. but too often I changed something and forgotten to change the manifest as well.

question: is there a way to have "real env variables", without adding them to all actions? I tried to use env vars starting with "__OW_" but that was not a success...

any hints hiw to do that?

8 Replies
duypnguyen
Employee
Employee

just to clarify - do you want to use some custom params you set yourself, or the default params available as __OW_* ? For default params you could do e.g. `process.env.__OW_NAMESPACE` (but should be careful that you may accidentally expose your namespace credentials).

ursboller
Community Advisor
Community Advisor
I have custom vars which I want to have access to in all actions. means any other solution than manually add them to all action params in the manifest.yml and the access the custom vars within the action.
ursboller
Community Advisor
Community Advisor
example - as an idea: I define "__OW_CUSTOMVARS_myVarName" and then access the value with an action with "process.env.__OW_CUSTOMVARS_myVarName"
duypnguyen
Employee
Employee
Ok - I don't think it is possible with I/O Runtime today, but agree that it's a very handy feature to have in "apps". Let me do some searches if any related enhancement ticket exists.
ursboller
Community Advisor
Community Advisor
@duynpguyen do you have any updates on this?
duypnguyen
Employee
Employee
@ursboller - I don't have any update yet, but did bring it up for more elaborated discussions with the team. I hope to share a more insightful feedback to you within the next weeks.
duypnguyen
Employee
Employee

Hi @ursboller  - I just recall a way to share the variables across your actions without repeating it in the manifest per action.

Because all actions are placed under the `__APP_PACKAGE__`, you could also set the default params of the package. Then you are able to get them in each action, just in the same manner as setting default params per action.

This is not yet part of the manifest.yaml definition, but you could use the CLI, e.g. `aio runtime package update sample-app-0.0.1 --param name "Firefly"`.