Stop running actions when new commit pushed to branch

It’s common with other CI environments that if you push one change (which triggers a build), and then push another right after (which triggers a second build) that the first build would be cancelled upon the second one being pushed.

Example: You push code, and your code style linter auto commits corrections a few seconds after. Now both builds are running instead of just the most recent.

Is there currently a way to do this with github actions?


It would indeed be nice to have an option for this in the repository settings to automatically cancel (generally) superfluous builds.

1 Like

@github it would be really nice to have an option to enable this.

1 Like

Thanks all. This is on our list. Agreed, would be a great feature to have configurable in the workflow file.


Thanks @mscoutermarsh :raised_hands: Please, is an estimation date available? When accepting suggestions from GUI, the number of commits increase and a huge amount of actions are queued. However, just the last actions are considered and reviewed. Thanks in advance!


Would also be nice if it was an option to configure it to stop the actions if the branch gets out of date with the selected base branch.