ID: autocancel

Build License: MIT

Autocancel builds with ease, heavily inspired by

While this can be achieved through Jenkinsfiles with a shared jenkins library, it requires adding multiple signatures to script approvals which can be potentially dangerous. A plugin fits better and can be reused across different kinds of jobs and jenkins instances.



Autocancel consecutive builds will ensure running builds are aborted when a new build starts, leaving always the latest build running.


node {
    // Steps


Autocancel branch builds on pull request builds will ensure running source branch builds are aborted when a new pull request build starts.

This could happen when a branch is pushed and immediately filed as a pull request, where branch build becomes redundant.

To match pull requests, the plugin leverages env.CHANGE_BRANCH, which should be set to the matching source branch name. Then, the plugin looks for branch jobs named as the source branch name under multibranch pipeline parent job to abort any running builds.

If env.CHANGE_BRANCH is not defined, the step will do nothing.


node {
    // Steps

Reference links

License and Software Information

© adidas AG

adidas AG publishes this software and accompanied documentation (if any) subject to the terms of the MIT license with the aim of helping the community with our tools and libraries which we think can be also useful for other people. You will find a copy of the MIT license in the root folder of this package. All rights not explicitly granted to you under the MIT license remain the sole and exclusive property of adidas AG.

NOTICE: The software has been designed solely for the purpose of analyzing the code quality by checking the coding guidelines. The software is NOT designed, tested or verified for productive use whatsoever, nor or for any use related to high risk environments, such as health care, highly or fully autonomous driving, power plants, or other critical infrastructures or services.

If you want to contact adidas regarding the software, you can mail us at

For further information open the adidas terms and conditions page.



ArchivesGet past versions
Version: 1.0.5
Requires Jenkins 2.164.3
Installs: 42
Help us improve this page!
To propose a change submit a pull request to the plugin page on GitHub.