Skip to content

feat: Add delete-branch option to delete PR branches after closing#190

Merged
hross merged 2 commits intoactions:mainfrom
alexbrazier:delete-branch
Jan 15, 2021
Merged

feat: Add delete-branch option to delete PR branches after closing#190
hross merged 2 commits intoactions:mainfrom
alexbrazier:delete-branch

Conversation

@alexbrazier
Copy link
Copy Markdown
Contributor

@alexbrazier alexbrazier commented Oct 8, 2020

Closes #57

Testing

  1. Setup PR which has delete-branch enabled Delete branch test to verify action alexbrazier/stale#2
  2. Verified it closed and deleted the test PR Delete me test alexbrazier/stale#1

image

image

@hross
Copy link
Copy Markdown
Contributor

hross commented Oct 9, 2020

This is an interesting option and I really appreciate your contribution. Deleting a branch is a somewhat destructive operation (it can be restored but not obviously with the click of a button) so I'm hesitant to include this in the stale bot.

@alexbrazier
Copy link
Copy Markdown
Contributor Author

alexbrazier commented Oct 9, 2020

@hross Happy for you to close this if you decide against including it. My understanding was you can restore a branch using the GitHub UI.
image
Not sure if the button is a permanent feature, or if it eventually expires, but my understanding of GitHub is that a PR diff with a deleted branch is available indefinitely?

Edit:

I just tested this in the example PR by restoring the branch using the "Restore branch" button and reopening the PR alexbrazier#1
image

@ChrisAnn
Copy link
Copy Markdown

I would also like this feature. We make a lot of PRs and many of which go stale so this would help us keep the number of useless branches down and our repo more efficient.
As it's an option, people can choose to turn it on and accept the risk :)

@hross hross self-requested a review January 15, 2021 11:49
@hross hross merged commit 107018c into actions:main Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Support deleting branches when closing PRs

3 participants