Skip to content

Instantly share code, notes, and snippets.

@elstgav
Last active June 28, 2022 00:31
Show Gist options
  • Save elstgav/e79ac1bee0dc2460c21f6709aa590940 to your computer and use it in GitHub Desktop.
Save elstgav/e79ac1bee0dc2460c21f6709aa590940 to your computer and use it in GitHub Desktop.
Delete all merged and closed GitHub PRs
document.querySelectorAll('.State--closed,.State--merged').forEach((node, index) => {
setTimeout(
() => node
.closest('.Details-content--shown')
.querySelector('.js-branch-delete-button')
.click(),
600 * index,
)
})
@elstgav
Copy link
Author

elstgav commented Jun 28, 2022

Simply paste this in the console and run while viewing stale branches, e.g. https://github.com/your/repo/branches/stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment