Skip to content

Commit

Permalink
Add a feature that migrates the issue notes(comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
buo committed May 27, 2016
1 parent 424cf58 commit 0d0a562
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions exe/lab2hub
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,24 @@ begin
labels: issue.labels
})
pp created

# Issue notes (comments)
notes = Gitlab.issue_notes(project.id, issue.id).auto_paginate

notes.select! do |note|
note.body != 'Status changed to closed' && note.body != 'Status changed to reopened'
end

# Sort by
notes.each do |note|
github.issues.comments.create({
user: repo.owner.login,
repo: repo.name,
number: created.number,
body: note.body
})
end

if issue.state == 'closed'
github.issues.edit({
user: repo.owner.login,
Expand Down

0 comments on commit 0d0a562

Please sign in to comment.