Start a workflow from another workflow

I have a special use case where I store a workflow file somewhere deep in a repository (and I don’t want to move it). I would like to execute this workflow in my actions.

I was thinking of having a regular workflow defined in .github/workflows which would call my other workflow file. A similar feature is possible for actions via - uses: ./custom_path where there’s a ./custom_path/action.yml file.

Is there a way to do the same with a workflow file?

1 Like

It’s currently not possible to reference another workflow like you can with actions. What you can do, however, is create a repository_dispatch event to trigger another workflow. You can do this with a curl command to call the GitHub API, but I’ve also written an action to simplify it a bit. See the README for an example of how to use it.

https://github.com/peter-evans/repository-dispatch

1 Like

Thanks. That doesn’t cover my use case unfortunately. As I mentioned, the workflow file is in another directory.

That’s currently not possible, sorry. Thanks for sharing your use case, will share with the team.

1 Like

https://blog.marcnuri.com/triggering-github-actions-across-different-repositories/