channable / hoff

A gatekeeper for your commits
Apache License 2.0
41 stars 3 forks source link

Automatically delete `testing/<id>` branch when PR#<id> is closed #164

Closed rudymatela closed 2 years ago

rudymatela commented 2 years ago

Since the introduction of #134, integration candidates of pull requests are each tested in their own testing/<id> branches.

When the build of a pull request succeeds :heavy_check_mark:, all is well. The pull request is merged and testing/<id> is deleted.

When the build of a pull request fails :x:, we leave testing/<id> hanging, in case the developer wants to inspect what happened to the rebase.

However, we do not want testing/<id> branches to hang around forever or to have to manually cleanup them, so we should delete these branches when the associated pull request is closed.

We should take care to check if the branch already exists before trying to delete it.