MigrationArchiveURL fetches a migration archive URL. id is the migration ID. GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#download-an-organization-migration-archive meta:operation GET /orgs/{org}/migrations/{migration_id}/archive
(ctx context.Context, org string, id int64)
| 178 | // |
| 179 | //meta:operation GET /orgs/{org}/migrations/{migration_id}/archive |
| 180 | func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { |
| 181 | u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) |
| 182 | |
| 183 | req, err := s.client.NewRequest(ctx, "GET", u, nil) |
| 184 | if err != nil { |
| 185 | return "", err |
| 186 | } |
| 187 | req.Header.Set("Accept", mediaTypeMigrationsPreview) |
| 188 | |
| 189 | loc, _, err := s.client.bareDoUntilFound(req, 10) |
| 190 | if err != nil { |
| 191 | return "", err |
| 192 | } |
| 193 | |
| 194 | if loc == nil { |
| 195 | return "", errors.New("expected redirect, none provided") |
| 196 | } |
| 197 | |
| 198 | return loc.String(), nil |
| 199 | } |
| 200 | |
| 201 | // DeleteMigration deletes a previous migration archive. |
| 202 | // id is the migration ID. |