A tool to migrate GitHub Repositories to Gitea including all issues
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
616 B

  1. package migrations
  2. import (
  3. "code.gitea.io/sdk/gitea"
  4. "github.com/google/go-github/github"
  5. )
  6. // Repository migrates a GitHub Repository to a Gitea Repository without migrating issues etc.
  7. func (m *Migratory) Repository(gr *github.Repository) (*gitea.Repository, error) {
  8. var err error
  9. m.repository, err = m.Client.MigrateRepo(gitea.MigrateRepoOption{
  10. Description: gr.GetDescription(),
  11. AuthPassword: m.AuthPassword,
  12. AuthUsername: m.AuthUsername,
  13. CloneAddr: gr.GetCloneURL(),
  14. RepoName: gr.GetName(),
  15. UID: int(m.NewOwnerID),
  16. Private: m.Private,
  17. })
  18. return m.repository, err
  19. }