1.0.2 • Published 4 years ago

expand-staged-yaml v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

expand-staged-yaml

This CLI utility is used to expand a source yaml file using anchors, aliases or merge feature of yaml into a plain yaml file.

Tools like Github Actions are not accepting yaml files with advanced features, like anchors or aliases. To mitigate that, we can plug this cli tool into a pre-commit hook. If the source file is changed, the target file will be generated with a expanded version of the original file, making it compatible with any yaml processor.

The yaml parser also support the yaml-import package, so you can include yaml import statements and they will also be expanded in the target file.

Running it

Just execute

expand-staged-yaml -s my-yaml-file.yaml -t my-plain-expanded-yaml-file.yaml

The target file is only generated if the source file is staged in git. You can add the -a option to staged the expanded file, in case you plug this tool in a pre-commit hook.

Examples

See this github workflow that generate this one

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago