File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,12 +288,13 @@ func (g *RepositoryDumper) CreateLabels(_ context.Context, labels ...*base.Label
288288func (g * RepositoryDumper ) CreateReleases (_ context.Context , releases ... * base.Release ) error {
289289 if g .opts .ReleaseAssets {
290290 for _ , release := range releases {
291- attachDir := filepath .Join ("release_assets" , release . TagName )
291+ attachDir := filepath .Join ("release_assets" , uuid . New (). String () )
292292 if err := os .MkdirAll (filepath .Join (g .baseDir , attachDir ), os .ModePerm ); err != nil {
293293 return err
294294 }
295295 for _ , asset := range release .Assets {
296- attachLocalPath := filepath .Join (attachDir , asset .Name )
296+ // we cannot use asset.Name because it might contains special characters.
297+ attachLocalPath := filepath .Join (attachDir , uuid .New ().String ())
297298
298299 // SECURITY: We cannot check the DownloadURL and DownloadFunc are safe here
299300 // ... we must assume that they are safe and simply download the attachment
You can’t perform that action at this time.
0 commit comments