This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
Support specifying custom environment variables for input variable default values #2362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This lets input variables specify any named environment variable as a source for a default value. Example:
If the
REGION
env var is set, it will populate the default value of this variable (Note:WP_VAR_region
takes priority always). If multiple env vars are specified, the first matching takes priority. If none of the defined env vars are set, thedefault
value (if set) is used. If no default is specified, it is an error since the variable is required and unset.The env vars specified here are loaded only at the runner (config evaluation time) currently. I'm unsure if we want to expand this to load at CLI time but I would say no, we only want WP_VAR_ variables there, unless the CLI also happens to be the runner (local mode).
This also fixes a potential bug I found where WP_VAR_ variables weren't loaded at runner-time. This could easily be as intended but I think we want to load those at runner-time too so that runner scoped configs can set variables for builds and so on.
TODO: I still have to write docs and validate this a bit more.