MCPcopy Index your code
hub / github.com/google/go-github / StartUserMigration

Method StartUserMigration

github/migrations_user.go:73–96  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

71//
72//meta:operation POST /user/migrations
73func (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//

Calls 2

NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 1