Skip to content

Commit

Permalink
fix(npm): don't publish sboms in npm package (SAP#4692)
Browse files Browse the repository at this point in the history
Co-authored-by: Anil Keshav <[email protected]>
  • Loading branch information
OliverNocon and anilkeshav27 authored Dec 13, 2023
1 parent 4f5ed26 commit 6587808
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/npm/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
oldWorkingDirectory, err := exec.Utils.Getwd()

scope, err := exec.readPackageScope(packageJSON)

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

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

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

func (exec *Execute) readPackageScope(packageJSON string) (string, error) {
b, err := exec.Utils.FileRead(packageJSON)

if err != nil {
return "", err
}
Expand Down

0 comments on commit 6587808

Please sign in to comment.