StartUserMigration starts the generation of a migration archive. repos is a slice of repository names to migrate. GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration meta:operation POST /user/migrations
(ctx context.Context, repos []string, opts *UserMigrationOptions)
| 71 | // |
| 72 | //meta:operation POST /user/migrations |
| 73 | func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { |
| 74 | u := "user/migrations" |
| 75 | |
| 76 | body := &startUserMigration{Repositories: repos} |
| 77 | if opts != nil { |
| 78 | body.LockRepositories = &opts.LockRepositories |
| 79 | body.ExcludeAttachments = &opts.ExcludeAttachments |
| 80 | } |
| 81 | |
| 82 | req, err := s.client.NewRequest(ctx, "POST", u, body) |
| 83 | if err != nil { |
| 84 | return nil, nil, err |
| 85 | } |
| 86 | |
| 87 | req.Header.Set("Accept", mediaTypeMigrationsPreview) |
| 88 | |
| 89 | var m *UserMigration |
| 90 | resp, err := s.client.Do(req, &m) |
| 91 | if err != nil { |
| 92 | return nil, resp, err |
| 93 | } |
| 94 | |
| 95 | return m, resp, nil |
| 96 | } |
| 97 | |
| 98 | // ListUserMigrations lists the most recent migrations. |
| 99 | // |