Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Developersチーム管理用スクリプト

  • Loading branch information...
commit cb6064837c505a0001244c179f1af54f43cf024a 1 parent 79d06d0
@mizzy authored
Showing with 36 additions and 0 deletions.
  1. +36 −0 manage_paperboy_developers.rb
View
36 manage_paperboy_developers.rb
@@ -0,0 +1,36 @@
+#!/usr/bin/env ruby
+
+require 'pit'
+require 'octokit'
+
+file = ARGV[0]
+
+if ! file
+ puts "Usage #{$0} file"
+ exit
+end
+
+def octokit
+ config = Pit.get('github', :require => {
+ 'username' => 'Your user name of GitHub',
+ 'password' => 'Your password of GitHub',
+ })
+ Octokit::Client.new(:login => config['username'], :password => config['password'])
+end
+
+puts `thor member:bulk_add --file=#{file} --organization=paperboy-all --team=Developers`
+
+teams = octokit.org_teams('paperboy-all')
+
+team_id = nil
+teams.each do |team|
+ if team.name == 'Developers'
+ team_id = team.id
+ end
+end
+
+octokit.org_repos('paperboy-all', { type: 'private' }).each do |repo|
+ puts "Adding #{repo.full_name} to paperboy ..."
+ octokit.add_team_repo(team_id, repo.full_name)
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.