I got added as a contributor in ~400 repositories in my organisation by accident. This JavaScript helped me undo that problem. Just head over to https://github.com/settings/repositories, change the logic for which repositories you want to leave and then run the leaveOne as many times as necessary.
Created
November 16, 2016 12:08
-
-
Save dsample/833b74c9f389c00bfa2e94c772d71894 to your computer and use it in GitHub Desktop.
A JavaScript snippet to help 'leave' many repositories where you have been added as a contributor
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
function leaveOne() { | |
const repos = document.getElementsByClassName('listgroup-item') | |
const repo = [].slice.call(repos).filter((item) => item.innerText.split('/')[0] == 'Leave xxx')[0] | |
console.log('repo', repo) | |
let name = repo.getElementsByClassName('mr-1')[1].innerText.split('/') | |
console.log("Leaving", name[1]) | |
repo.getElementsByClassName('float-right')[0].click() | |
setTimeout(() => { | |
// document.getElementsByClassName('facebox-close')[0].click() | |
document.getElementById('facebox').getElementsByClassName('btn')[0].click() | |
}, 250) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment