Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

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?

3 Replies
Copilot Lvl 3
Message 2 of 4

Re: Start a workflow from another workflow

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

Copilot Lvl 2
Message 3 of 4

Re: Start a workflow from another workflow

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

GitHub Staff
Message 4 of 4

Re: Start a workflow from another workflow

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