Skip to content

Instantly share code, notes, and snippets.

@afeld
Created January 22, 2016 19:35
Show Gist options
  • Save afeld/456e33693bcae702a5dd to your computer and use it in GitHub Desktop.
Save afeld/456e33693bcae702a5dd to your computer and use it in GitHub Desktop.
private GitHub repositories in an organization
require 'octokit'
Octokit.auto_paginate = true
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
repos = client.organization_repositories('18F')
private_repos = repos.select(&:private)
private_repos.sort_by!(&:name)
private_repos.each do |repo|
puts [
repo.name,
repo.description
].compact.join(' – ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment