1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

fix(npm): don't publish sboms in npm package (#4692)

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
This commit is contained in:
Oliver Nocon 2023-12-13 18:36:59 +01:00 committed by GitHub
parent 4f5ed26031
commit 6587808062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,6 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
oldWorkingDirectory, err := exec.Utils.Getwd() oldWorkingDirectory, err := exec.Utils.Getwd()
scope, err := exec.readPackageScope(packageJSON) scope, err := exec.readPackageScope(packageJSON)
if err != nil { if err != nil {
return errors.Wrapf(err, "error reading package scope from %s", packageJSON) return errors.Wrapf(err, "error reading package scope from %s", packageJSON)
} }
@ -82,6 +81,8 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
// temporary installation folder used to install BOM to be ignored // temporary installation folder used to install BOM to be ignored
log.Entry().Debug("adding tmp to npmignore") log.Entry().Debug("adding tmp to npmignore")
npmignore.Add("tmp/") npmignore.Add("tmp/")
log.Entry().Debug("adding sboms to npmignore")
npmignore.Add("**/bom*.xml")
npmrc := NewNPMRC(filepath.Dir(packageJSON)) npmrc := NewNPMRC(filepath.Dir(packageJSON))
@ -206,7 +207,6 @@ func (exec *Execute) publish(packageJSON, registry, username, password string, p
func (exec *Execute) readPackageScope(packageJSON string) (string, error) { func (exec *Execute) readPackageScope(packageJSON string) (string, error) {
b, err := exec.Utils.FileRead(packageJSON) b, err := exec.Utils.FileRead(packageJSON)
if err != nil { if err != nil {
return "", err return "", err
} }