jeffwidman / bitbucket-issue-migration

A small script for migrating repo issues from Bitbucket to GitHub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't import to private github repos

pilgrim2go opened this issue · comments

Hi Jeff,

Thanks for your work and share.

I can use your script to migrate to my public repo but not private repo.

Ended up tweak a little bit

def push_github_issue(issue, comments, github_repo, auth, headers):
    issue_data = {'issue': issue, 'comments': comments}
    issue_data.update(issue) (1)
    url = 'https://api.github.com/repos/{repo}/issues'.format(
        repo=github_repo) (2)

.... 
     if respo.status_code in [202,201]: (3)
        return respo

(1) (2)
Follow https://developer.github.com/v3/issues/#create-an-issue to create GH issue instead of importing it
(3) Naively add another response code (201)

At this step, I'm able to migrating issues from BB to Github.

I'd better to create pull requests but due to limit of time, I'd like to create an issue so you can consider it.

Thanks again.

Hmm... what error did you see?

Multiple people have reported successfully importing to private GitHub repos, so not sure why you would need to make these changes...