Created
June 7, 2014 22:19
-
-
Save aroman/44d7b85cbd954bd54616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gitlab' | |
require 'octokit' | |
Gitlab.configure do |c| | |
c.endpoint = 'http://projects.elementaryos.org/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT'] | |
c.private_token = '<redacted>' # username for sudo mode, default: nil | |
end | |
gh = Octokit::Client.new(:access_token => '<redacted>') | |
GITLAB_PROJECT = 7 # web/ci-site | |
GITHUB_PROJECT = "elementary/org-issues" | |
Gitlab.issues(GITLAB_PROJECT, per_page => 100).each do |issue| | |
# puts issue.title | |
notes = Gitlab.issue_notes(GITLAB_PROJECT, issue.id) | |
description = "[@#{issue.author.username} (#{issue.author.name}) created on GitLab]\n\n#{issue.description}" | |
new_issue = gh.create_issue(GITHUB_PROJECT, issue.title, description) | |
notes.each do |note| | |
comment = "[@#{note.author.username} (#{note.author.name}) commented on GitLab]\n\n#{note.body}" | |
gh.add_comment(GITHUB_PROJECT, new_issue.number, comment) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment