Skip to content

Commit 6587808

Browse files
fix(npm): don't publish sboms in npm package (SAP#4692)
Co-authored-by: Anil Keshav <[email protected]>
1 parent 4f5ed26 commit 6587808

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/npm/publish.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
5858
oldWorkingDirectory, err := exec.Utils.Getwd()
5959

6060
scope, err := exec.readPackageScope(packageJSON)
61-
6261
if err != nil {
6362
return errors.Wrapf(err, "error reading package scope from %s", packageJSON)
6463
}
@@ -82,6 +81,8 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
8281
// temporary installation folder used to install BOM to be ignored
8382
log.Entry().Debug("adding tmp to npmignore")
8483
npmignore.Add("tmp/")
84+
log.Entry().Debug("adding sboms to npmignore")
85+
npmignore.Add("**/bom*.xml")
8586

8687
npmrc := NewNPMRC(filepath.Dir(packageJSON))
8788

@@ -206,7 +207,6 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
206207

207208
func (exec *Execute) readPackageScope(packageJSON string) (string, error) {
208209
b, err := exec.Utils.FileRead(packageJSON)
209-
210210
if err != nil {
211211
return "", err
212212
}

0 commit comments

Comments
 (0)