Skip to content

Commit

Permalink
Use access token
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzy committed Nov 23, 2013
1 parent 497799b commit 82f5f28
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
25 changes: 9 additions & 16 deletions Gemfile.lock
@@ -1,24 +1,17 @@
GEM
remote: http://rubygems.org/
specs:
addressable (2.3.3)
faraday (0.8.6)
multipart-post (~> 1.1)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
hashie (1.2.0)
multi_json (1.6.1)
addressable (2.3.5)
faraday (0.8.8)
multipart-post (~> 1.2.0)
multipart-post (1.2.0)
netrc (0.7.7)
octokit (1.23.0)
addressable (~> 2.2)
faraday (~> 0.8)
faraday_middleware (~> 0.9)
hashie (~> 1.2)
multi_json (~> 1.3)
netrc (~> 0.7.7)
octokit (2.6.1)
sawyer (~> 0.5.1)
pit (0.0.7)
thor (0.17.0)
sawyer (0.5.1)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
thor (0.18.1)

PLATFORMS
ruby
Expand Down
5 changes: 2 additions & 3 deletions manage-ghe.rb
Expand Up @@ -14,10 +14,9 @@
end

config = Pit.get('ghe', :require => {
'username' => 'Your user name of GitHub Enterprise',
'password' => 'Your password of GitHub Enterprise',
'access_token' => 'Your access_token of GitHub Enterprise',
})
octokit = Octokit::Client.new(:login => config['username'], :password => config['password'])
octokit = Octokit::Client.new(:access_token => config['access_token'])

users = []
last_id = 0
Expand Down
6 changes: 3 additions & 3 deletions manage_paperboy.rb
Expand Up @@ -11,10 +11,10 @@
end

config = Pit.get('github', :require => {
'username' => 'Your user name of GitHub',
'password' => 'Your password of GitHub',
'access_token' => 'Your access token of GitHub',
})
octokit = Octokit::Client.new(:login => config['username'], :password => config['password'])

octokit = Octokit::Client.new(:access_token => config['access_token'])

puts `thor member:bulk_add --file=#{file} --organization=paperboy-all --team=paperboy`

Expand Down
5 changes: 2 additions & 3 deletions manage_paperboy_developers.rb
Expand Up @@ -12,8 +12,7 @@

def octokit
config = Pit.get('github', :require => {
'username' => 'Your user name of GitHub',
'password' => 'Your password of GitHub',
'access_token' => 'Your access_token of GitHub',
})
Octokit::Client.new(:login => config['username'], :password => config['password'])
end
Expand All @@ -30,7 +29,7 @@ def octokit
end

octokit.org_repos('paperboy-all', { type: 'private' }).each do |repo|
puts "Adding #{repo.full_name} to paperboy ..."
puts "Adding #{repo.full_name} to Developers team ..."
octokit.add_team_repo(team_id, repo.full_name)
end

0 comments on commit 82f5f28

Please sign in to comment.