Skip to content

Commit a228303

Browse files
committed
inline the change
1 parent 707fc17 commit a228303

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

services/migrations/dump.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,13 @@ func (g *RepositoryDumper) CreateLabels(_ context.Context, labels ...*base.Label
288288
func (g *RepositoryDumper) CreateReleases(_ context.Context, releases ...*base.Release) error {
289289
if g.opts.ReleaseAssets {
290290
for _, release := range releases {
291-
relDir := uuid.New().String()
292-
attachDir := filepath.Join("release_assets", relDir)
291+
attachDir := filepath.Join("release_assets", uuid.New().String())
293292
if err := os.MkdirAll(filepath.Join(g.baseDir, attachDir), os.ModePerm); err != nil {
294293
return err
295294
}
296295
for _, asset := range release.Assets {
297-
p := uuid.New().String()
298296
// we cannot use asset.Name because it might contains special characters.
299-
attachLocalPath := filepath.Join(attachDir, p)
297+
attachLocalPath := filepath.Join(attachDir, uuid.New().String())
300298

301299
// SECURITY: We cannot check the DownloadURL and DownloadFunc are safe here
302300
// ... we must assume that they are safe and simply download the attachment

0 commit comments

Comments
 (0)