Fixing custom asset id upload (#2305)

fixing custom asset id
This commit is contained in:
Mzack9999
2025-11-08 00:53:37 +04:00
committed by GitHub
parent 4d965745f9
commit 27a22c6ac6
2 changed files with 4 additions and 4 deletions
+2 -1
View File
@@ -131,10 +131,11 @@ func setupOptionalAssetUpload(opts *runner.Options) *pdcp.UploadWriter {
opts.OnClose = func() {
writer.Close()
}
// add additional metadata
if opts.AssetID != "" {
// silently ignore
_ = writer.SetAssetID(opts.AssetID)
writer.SetAssetID(opts.AssetID)
}
if opts.AssetName != "" {
// silently ignore
+2 -3
View File
@@ -99,12 +99,11 @@ func (u *UploadWriter) GetWriterCallback() runner.OnResultCallback {
}
// SetAssetID sets the scan id for the upload writer
func (u *UploadWriter) SetAssetID(id string) error {
func (u *UploadWriter) SetAssetID(id string) {
if !xidRegex.MatchString(id) {
return fmt.Errorf("invalid asset id provided")
gologger.Warning().Msgf("invalid asset id provided (unknown xid format): %s", id)
}
u.assetGroupID = id
return nil
}
// SetAssetGroupName sets the scan name for the upload writer