We have the situation that we get a lot commits in PRs and this results in long queue of builds where only the last one needs to run. It would be good if a build can be canceled when a new commit is pushed to a PR. Any chance to do this, maybe a script or plugin?
Any help is appreciated, thanks in advance.
You could use webhooks combined with the Drone API to do something like this:
- Drone triggers webhooks to service (service is a program you create)
- Service receives webhook and filters webhooks with event == build and action == create
- Service uses the API to fetch a list of recent builds for the repository
- Service makes API calls to cancel pending pull request builds
Thanks for the fast answer, sounds doable.
Support here is always great, thanks for being so responsible.
Took some time but I tried it and I am not sure if I made a mistake. I can’t see the webhook coming in and have not really a idea where to look now.
Here is what I did:
to the docker-compose.yml
Has something changed or is there a place I can look further.