Prevent parallel workflows?

Is there any way to prevent the same workflow from running more than once at the same time?

For example, I have a workflow to deploy to our dev environment on any push to master. If multiple pull requests are merged one after the other, the workflow will run multiple times which could cause a race condition where the most recent commit isn’t the one that finally gets deployed.

27 Likes

There is currently no way to force a workflow to have only one run at a time.  As we look forward to more formal support for continuous delivery scenarios this is somthing we will look to address.

1 Like

I would say this is quite a critical feature. One that would prevent us from migrating from Travis to GH Actions. Our use case: Each build starts the integration tests. The integration tests deal with one data store, where they clean it completely and then start running tests on it. If more than one instance of the integration tests run in parallel, it would mean that tests will be modifying that one data store in parallel, which would lead to race conditions and eventually both fail.

22 Likes

I have just run into this same problem.  Are there any updates Chris?

Thank you!

3 Likes

@chrispat Any updates on this? I can’t think of a CD scenario, where parallel workflow executions are acceptable.

4 Likes

I think is a bit disingenuous to mark this as solved when you are just considering to work on it at the moment.

7 Likes

Just want to say this would be great to have and save us from having to orchestrate this ourselves with external systems.

Check this one up How to limit concurrent workflow runs

@chrispat is this an issue that could be put on the github roadmap? That way the issue can actually be followed.

I think that I may have noticed this happen which caused a failing test to “pass” unexpectedly. I had not seen this discussion, but I explained the circumstances here.