Over the course of our work with Github and Github Classroom, we’ve run into some situations where faculty accidentally used our main organization repo for their course, causing thousands of repos to be created in that organization over several semesters of such mistakes.
I’ve written some code using the “octokit.js” library that can get listings of all the repos in an organization and can archive repos in an organization, which work as expected. That still leaves those repos in the main list for the org, so if possible, I’d really like to transfer them to appropriate new orgs of their own within our enterprise.
However, it seems that, while there’s an endpoint in the API to support it and both organizations are within our enterprise, in order to transfer a repo, there has to be a button click acceptance on the new owner repo. For bulk transferring repos in the thousands, that’s a non-starter.
Has anyone successfully scripted this? Is there some webhook we can add/use that allows responding to a repo transfer request in an automated way?
Thanks in advance for any assistance!