Skip to content

Instantly share code, notes, and snippets.

@newbamboo
Created March 22, 2012 16:08
Show Gist options
  • Save newbamboo/2159238 to your computer and use it in GitHub Desktop.
Save newbamboo/2159238 to your computer and use it in GitHub Desktop.
Script to find all your repositories that have a particular collaborator.
require 'rubygems'
require 'github_api'
username = ARGV[0]
password = ARGV[1]
collaborator_for_deletion = ARGV[2]
client = Github.new(login: username, password: password)
repositories = client.repos.list
repositories.each_page do |page|
page.each do |repository|
if client.repos.collaborators.collaborator?(username, repository.name, collaborator_for_deletion)
puts "#{repository.name}: #{repository.html_url}/admin/collaboration"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment