File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -308,13 +308,14 @@ func runGithubPage(opts *githubPageCmdLineOptions) (err error) {
308
308
}
309
309
}
310
310
311
- newAssets := make ( []string , len ( assets ) + 1 )
312
- for i , a := range assets {
313
- newAssets [ i ] = a .ReadFrom
311
+ var newAssets []string //nolint: prealloc,gocritic
312
+ for _ , a := range assets {
313
+ newAssets = append ( newAssets , a .ReadFrom )
314
314
}
315
-
316
315
// add sbom to the path to upload
317
- newAssets [len (assets )] = sbomStr
316
+ if sbomStr != "" {
317
+ newAssets = append (newAssets , sbomStr )
318
+ }
318
319
319
320
// Build the release page options
320
321
ghOpts := github.Options {
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ func (i *defaultImpl) github() *githubsdk.GitHub {
49
49
func (i * defaultImpl ) processAssetFiles (assetFiles []string ) (releaseAssets []map [string ]string , err error ) {
50
50
// Check all asset files and get their hashes
51
51
for _ , path := range assetFiles {
52
+ if path == "" {
53
+ continue
54
+ }
55
+
52
56
assetData := map [string ]string {
53
57
"rawpath" : path ,
54
58
"name" : "" ,
You can’t perform that action at this time.
0 commit comments