Reusable workflows limiting folder structure

Hello, I would like to ask if there is any plan on allowing reusable workflows to be triggered from outside of .github/workflow folder.

I find this to be a limitation as I cannot “nicely” organize my org’s workflows. Maybe even have a repo per a “workflow type”.

For example we use sbt, mave and some general workflows.
Now if I have them in one repo in one folder for the org, I get this and I think it can grow too large

- .github
  - CODEOWNERS
  - ISSUE_TEMPLATE
  - workflows
    - maven_license_check.yml
    - maven_build.yml
    - maven_publish.yml
    - sbt_license_check.yml
    - sbt_build.yml
    - sbt_publish.yml
    - pr_labels_check.yml
    - pr_description_check.yml

What seems more usable to me and what I am asking for is

- .github
  - CODEOWNERS
  - ISSUE_TEMPLATE
- sbt
  - license_check.yml
  - build.yml
  - publish.yml
- maven
  - license_check.yml
  - build.yml
  - publish.yml
- general
  - labels_check
  - description_check

Last option would be to have multiple repositories like this

- org/reusable-workflows-maven
- org/reusable-workflows-sbt
- org/reusable-workflows-general

Any thoughts or comments from the community are appreciated.

2 Likes

I see Reusable Workflows as a kind of advanced Composite Action—note that I have not tried the former yet—and would store them under .github/workflows/actions/.

1 Like

I would probably be even somewhat happy if I could create folders in .github/workflows but when I try that I get

invalid value workflow reference: workflows must be defined at the top level of the .github/workflows/ directory

According to the GitHub Docs (at the time this post):

[…] As with other workflow files, you locate reusable workflows in the .github/workflows directory of a repository. [Subdirectories of the workflows directory are not supported.]

Reusing workflows

Which is unfortunate. I apologize for my previously unverified proposal.

For the time being, we will have to stick to some sort of file naming convention to distinguish between “caller” workflows and “called” workflows.