futurelearn / squiddy

Github Actions bot
1 stars 1 forks source link

Make deleting branch optional #16

Closed elenatanasoiu closed 3 years ago

elenatanasoiu commented 3 years ago

Some repos have the "delete_branch_on_merge" option turned on which means once a PR merge is successful, the branch will be deleted automatically.

After improving error messages for squiddy we can see that when it attempts to delete the merged branch, it sometimes gets an error back (which was previously silent):

Error message:
DELETE https://api.github.com/repos/futurelearn/futurelearn/git/refs/heads/jrwc-make-cookie-banner-feature-flag-apply-in-dev: 
422 - Reference does not exist // See: https://docs.github.com/rest/reference/git#delete-a-reference

Let's check the repo for this setting before attempting to delete the branch.

Tested here: