I was getting tired of duplicating yaml files for workflows and jobs, so I made a CLI tool to streamline the process. From discussions I’ve seen elsewhere on these forums I figured it may be of interest to others.
The repo is here: https://github.com/jbrunton/gflows
It doesn’t do anything you couldn’t do with existing templating tools and a bunch of bash scripting, but the aim was to make it extremely simple to use. It basically integrates a few existing tools:
- Currently, ytt or Jsonnet as the templating engines.
- A json schema to validate the generated workflow.
- A command that validates workflows are up to date with their source templates (run as a CI step).
- A watch option, so you can get fast feedback when refactoring workflows.
It doesn’t magically make the yaml in .github/workflows disappear, but it does mean you can use these other templating engines to share code, break up files and DRY up your configuration.
Hopefully it will be of some use to others. I’d be keen to hear any feedback, and if anyone’s interested in collaborating (e.g. to add further templating engines) that would be great.