Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading