Skyscanner / turbolift

A simple tool to help apply changes across many GitHub repositories simultaneously
Apache License 2.0
435 stars 34 forks source link

Functionality to cleanup forks after a campaign is complete #6

Open rnorth opened 3 years ago

rnorth commented 3 years ago

As-is, turbolift users will end up with large numbers of forks in their personal org. This is annoying, and cleaning these up is a chore.

We should have a turbolift cleanup feature to delete a user's forks.

We should discuss safety aspects, e.g. should we avoid deleting forks if:

Some combination of warnings/prompts may help.

janeklb commented 3 years ago

In the meantime, you can use turbolift foreach in combination with the gh cli tool: (replace $USER if necessary) (your github token will need to have delete_repo permissions checked)

turbolift foreach 'gh api -X DELETE repos/$USER/$(basename $(pwd))'

(of course be careful with this in case you have your own repos that you were turbolifting... )

rnorth commented 1 year ago

@sledigabel's suggestion: add a label to the forked repo indicating that the fork was created for turbolift, and add a new label for each campaign that uses a given fork. Use this to add a safety guard to turbolift cleanup so that we don't accidentally delete forks that are still in use for other purposes.

Another suggestion (in parallel)?

turbolift cleanup list dumps a list of repos that could be cleaned up to a file User hand-edits the file - potentially an interactive $EDITOR session? turbolift cleanup apply actually does the deletion