githubtraining / training-manual

Home of the words in the GitHub Training Manual and teaching scripts.
https://githubtraining.github.io/training-manual
Creative Commons Attribution 4.0 International
267 stars 266 forks source link

Delete training repos after a few months. #404

Open rulasg opened 12 months ago

rulasg commented 12 months ago

As a trainer I would like GH to delete exiting repos a few months later than creation, aka training date. So that if the same student goes to the same training later, the creation of new repos will not fail for the new training.

I had a training where a student had already a repo created. He did not have access to it as the invitation had expired already. As I am not the creator I could not remove the repo to allow the script create the a new one for my training.

collision repo

CC: @mericstam

amyschoen commented 12 months ago

I was considering adding back time-based repo clean up to the scripts similar to what we had initially. Not sure that would solve your problem since it sounds like your issue is that you cannot delete repos. Is it possible to add repo deletion rights to your token, or do you not have the ability to delete repos in the org you're using? We teach from a practice org where I make my instructors org owners.

rulasg commented 12 months ago

Hi @amyschoen I can not delete the repo because I did not create it. The repo was left behind by another trainer months back. I have no problem cleaning repos I created with option 7 of the script.

Adding a cleanup step or even better a garbage collector workflow that removes all repos older than 2 months would fix the problem. 😄

Thanks.

amyschoen commented 12 months ago

I like the workflow idea. It's on my to-do list to look into adding workflows for generating repos when I have some time since my current efforts to add GHEC support have experienced some hiccups.