Control workflow and files from a master repo

41 Views Asked by At

I would like to use an admin repo, where some Github actions should be developed and some static config files should be set. The idea is then to use Backstage to use the admin repo as a template.

I have the following repo, that I want to be either symlinked or tracked by the admin repo.

 | - admin-repo
  | - .github
  |  | - workflows
  |  |  | - admin_workflow.yml
  | - config.yml

And then I have a provisioned repo, that should be either symlinked or use the repo from admin.

 | - provisioned-repo
  | - .github
  |  | - workflows
  |  |  | - custom_workflow.yml
  |  |  | - admin_workflow.yml (from admin-repo@commit-xyz)
  | - config.yml (from admin-repo@commit-fizz)

I read about reusable workflows and git submodules. When should one use what and what is best?

1

There are 1 best solutions below

0
On BEST ANSWER

Reusing workflow seems much easier to implement in your current workflow rather than:

  • referencing another repository as submodule in your current repo
  • making the necessary symlink to that submodule repository workflow file (from your repository .github/workflow)

It is best to use the native mechanism put in place by Github.