Created
July 5, 2021 12:08
-
-
Save lgk-bsw/0b56117aeccd0e55e0d7c611d5e23a77 to your computer and use it in GitHub Desktop.
Run this on the branches page of a GitHub repo to delete all merged or closed branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rows = document.querySelectorAll("div[data-target='branch-filter.result'] .Box-row") | |
for (const r of rows) { | |
const stateEl = r.querySelector(".State") | |
if (stateEl && (stateEl.title.includes("Merged") || stateEl.title.includes("Closed"))) { | |
r.querySelector(`button[data-target="branch-filter-item.destroyButton"]`).click() | |
} | |
//confirm("Continue?") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment