API for explicitly declared environment variables in workflow #198277
Replies: 2 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
This seems like a reasonable feature request. Currently, actions can access the runtime environment, but there isn't a supported way (that I'm aware of) to distinguish:
For actions like Cross-Platform Action, automatically forwarding only user-defined One possible implementation could be:
That would remove the need for: with:
environment_variables: MY_ENV1 MY_ENV2and allow actions to safely propagate only the variables intentionally provided by the user. Until something like this exists, explicitly listing the variables is probably the safest approach from both a compatibility and security standpoint. 👍 I can definitely see this being useful for VM/container actions and other environment-isolation tools. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Product Feedback
💬 Feature/Topic Area
Other
Discussion Details
I would like an API, of some kind, to get access to those environment variables explicitly declared in a workflow file using the
env:syntax.I'm the author of the Cross-Platform Action [1], which is a GitHub action that starts a virtual machine (VM). To expose environment variables inside the VM that are declared outside, the user currently needs to explicitly list which environment variables should be exposed inside the VM. It would be a better user experience if the action could automatically expose all environment variables the user is interested in. It wouldn't make sense to expose all environment variables that are available outside the VM, because that would cause conflict with environment variables inside the VM like
PWDandHOME. Instead if there could be an API that allows the action to only get the environment variables (the names and the values) that are explicitly declared using theenv:syntax,MY_ENV1andMY_ENV2in the example below. It shouldn't matter at which level the in the workflow file the environment variables are declared.[1] https://github.com/cross-platform-actions/action
Beta Was this translation helpful? Give feedback.
All reactions