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

Triggering a new workflow from another workflow

Per https://help.github.com/en/articles/events-that-trigger-workflows, workflows cannot trigger other workflow runs when using GITHUB_TOKEN:

 

> An action in a workflow run can't trigger a new workflow run. For example, if an action pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.

 

I'm curious if this is a temporary limitation, and if this will be removed in the future. I can understand the reasoning for it, but it's limiting for certain types of things that can be automated.

 

One example is using the deployments API with Actions. I'd like to build one workflow that handles `/deploy` comments in PR's to create GitHub Deployments, and then have another workflow that handles them. As of right now, that's not possible if the workflow that creates the deployment uses GITHUB_TOKEN.

 

The only way to work around this right now is the either 1) create a bot user and use a personal access token or 2) create a github app. Both of these are cumbersome, and suck for various reasons.

15 Replies
Highlighted
Pilot Lvl 2
Message 2 of 16

Re: Triggering a new workflow from another workflow

Hello,

 

Is there any update on this topic from the GitHub side ? 

 

Thanks in Advance. 

Highlighted
GitHub Staff
Message 3 of 16

Re: Triggering a new workflow from another workflow

The documented limitation is still in place.  However, as we look at other scenarios specifically around continuous deployment we will likely adjust this behavior for specific scenarios.

Highlighted
Pilot Lvl 1
Message 4 of 16

Re: Triggering a new workflow from another workflow

I have the same issue while pushing newly formated code. Is there any workaround? Even with Github API?

Pilot Lvl 1
Message 5 of 16

Re: Triggering a new workflow from another workflow

I've fallen back to using a custom auth token (linked to a bot account), which will trigger the checks on commit/push.

Highlighted
Copilot Lvl 3
Message 6 of 16

Re: Triggering a new workflow from another workflow

My use case is automatically creating a PR from feature branch to master branch when there is a push to the feature branch.

 

When a new PR is created, I have a few things I do with it, such as look up the related issue using commit messages; add the PR to a project; add some more details to the PR; etc. However, I can't do any of that if the PR workflow doesn't run following the push workflow.

 

Is there a specific technical reason why the limitation exists? Such as unintended infinite feedback loops of workflows? Because you can probably limit that to some depth using the token -- I doubt most of us needing this functionality would need anything more than 3 levels of chaining.

Highlighted
Copilot Lvl 3
Message 7 of 16

Re: Triggering a new workflow from another workflow

Hi Chris, do you have any news on this? I just bumped into yet another issue that made Coveralls break for me: https://github.com/coverallsapp/github-action/issues/19#issuecomment-553078356

Highlighted
Copilot Lvl 3
Message 8 of 16

Re: Triggering a new workflow from another workflow

Is this still the case? I'm actually seeing workflows being triggered from commits pushed with GITHUB_TOKEN, which I was hoping it wouldn't...

Highlighted
Copilot Lvl 3
Message 9 of 16

Re: Triggering a new workflow from another workflow

Are you using the defeult GITHUB_TOKEN, the one on the name of GitHub Actions, or a custom one?

Highlighted
Copilot Lvl 2
Message 10 of 16

Re: Triggering a new workflow from another workflow

Any update on this? Trying to get https://github.com/tibdex/autosquash working when all checks have successfully completed and not having any luck. Thanks!