use github action workflow file of another repository

Viewed 1867

I have multiple repositories with the same github-actions build job.

Currently I duplicate the workflow files, but it is the same between all the repositories, so if I could do an import it would be better.

How can I import the same workflow file in all those repositories?

1 Answers

It looks that at the moment there is no out-of-the-box support for this. Please check this issue.

But you can take a look on GFlows - GitHub Workflow Templates

GFlows is a CLI tool that makes templating GitHub Workflows easy, using either Jsonnet or ytt (Yaml Templating Tool). It can:

  • Import existing workflows to help you quickly get started.
  • Validate GitHub workflows are up to date with their source templates and conform to a valid schema.
  • Share common config code and workflows with GFlows Packages.
  • Watch changes to the templates, so you can develop and refactor workflows with fast feedback on your changes.
Related