Open Vadorequest opened 1 year ago
Maybe it would be a good start to add general property "import" or "include" and possibly enable it to be either array or single value.
For instance: `import:
some-other-file.yaml`
or import: some-file.yaml
The logic behind should probably be equal to grabbing content and adding it to same level where the import is. I was also thinking to add possibility to include env files, but that should probably be separate property like "env-import".
for instance:
build:
(...)
import-env: ./some-file.env
env:
ENV-1: env-value
(...)
steps:
- import: ./some-file-with-steps.yaml
This example would finally have env variables added to env from file in import-env
and steps would contain all steps from file in import
.
I'm not sure those options are actually being supported, we don't intend to change how YAML works.
I think, the idea of reusability is probably impossible to implement without actually altering either yaml file or how yaml file is being processed. Maybe we do not need to copy/paste snippets and create another final yaml... maybe the only thing is to add some extra logic behind importing/including the other files. I am interested in this feature so I will be watching this feature regardless of the outcome.
Is your feature request related to a problem? Please describe. Some code is duplicated in the GHA workflows because we don't know how to reuse it.
Describe the solution you'd like See if https://github.com/actions/starter-workflows/issues/245#issuecomment-1445128447 could yield better solutions.