Skip to content

Instantly share code, notes, and snippets.

@philandstuff
Forked from tijmenb/transfer.rb
Last active April 4, 2018 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philandstuff/40b2edb65b0d820463390eba989bced2 to your computer and use it in GitHub Desktop.
Save philandstuff/40b2edb65b0d820463390eba989bced2 to your computer and use it in GitHub Desktop.
require 'octokit'
client = Octokit::Client.new(access_token: "<TOKEN>")
repos = client.repos('gds-attic')
repos.take(10).each do |repo|
puts "archiving #{repo.url}..."
client.post(
"#{repo.url}/transfer",
new_owner: "alphagov",
accept: "application/vnd.github.nightshade-preview+json"
)
client.edit_repository(
"alphagov/#{repo.name}",
archived: true
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment