Skip to content

Instantly share code, notes, and snippets.

@furaji
Created July 3, 2014 12:16
Show Gist options
  • Save furaji/9d7ee5e53a2882c09f6d to your computer and use it in GitHub Desktop.
Save furaji/9d7ee5e53a2882c09f6d to your computer and use it in GitHub Desktop.
githubのissueを複製する
require "octokit"
before_rep = "name/repname"
after_rep = "other_name/other_repname"
client = Octokit::Client.new(access_token: ENV["GITHUB_API_TOKEN"])
options = {
state: :all
}
issues = client.list_issues before_rep, options
p "issueは#{issues.count}件あります"
issues.each.with_index(1) do |issue, index|
client.create_issue(after_rep, issue.title, issue.body)
p "#{index}件目のissueを登録しました"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment