[Feature] Build auto cancel

Travis CI’s Auto Cancellation feature can really help to save resources on CI cluster when a user is keep committing or changing something especially on GitHub web gui since they can’t work on multiple fine at a single time, is it possible to request this feature on Drone? Thanks!


Great idea, can you create an issue in the tracker with a detailed description of how each flag behaves? Thanks!

1 Like

Done: https://github.com/drone/drone/issues/1980 Thanks!

Hello, what is the status, where can I find docs about it? Thx

@bradrydzewski sorry to bring up such an old thread, but did anything ever come of this feature? The linked github issue is no longer available!

@microadam it looks like we don’t expose the options in the user interface yet (we should) but you can configure a repository to auto-cancel push or pull request pipelines that are pending in-queue using the command line tools (see relevant flags below). Note that we do not auto-cancel running builds; only pending builds that have not yet started.

% drone repo update --help
   drone repo update - update a repository

   drone repo update [command options] <repo/name>

   --trusted                    repository is trusted
   --protected                  repository is protected
   --timeout value              repository timeout (default: 0s)
   --visibility value           repository visibility
   --ignore-forks               ignore forks
   --ignore-pull-requests       ignore pull requests
   --auto-cancel-pull-requests  automatically cancel pending pull request builds
   --auto-cancel-pushes         automatically cancel pending push builds
   --config value               repository configuration path (e.g. .drone.yml)
   --build-counter value        repository starting build number (default: 0)
   --unsafe                     validate updating the build-counter is unsafe

Ahh amazing! thank you for the insight, much appreciated!