diff --git a/knowledge-base/actions/angular/dev-infra/github-actions/lock-closed/action-security.yml b/knowledge-base/actions/angular/dev-infra/github-actions/lock-closed/action-security.yml deleted file mode 100644 index 051053cd..00000000 --- a/knowledge-base/actions/angular/dev-infra/github-actions/lock-closed/action-security.yml +++ /dev/null @@ -1,2 +0,0 @@ -name: 'Lock Closed Issues' # angular/dev-infra/github-actions/lock-closed -# GITHUB_TOKEN not used diff --git a/remediation/dependabot/dependabotconfig.go b/remediation/dependabot/dependabotconfig.go index 26609cd3..33483297 100644 --- a/remediation/dependabot/dependabotconfig.go +++ b/remediation/dependabot/dependabotconfig.go @@ -105,7 +105,7 @@ func UpdateDependabotConfig(dependabotConfig string) (*UpdateDependabotConfigRes for _, Update := range updateDependabotConfigRequest.Ecosystems { updateAlreadyExist := false for _, update := range configMetadata.Updates { - if update.PackageEcosystem == Update.PackageEcosystem && update.Directory == Update.Directory { + if update.PackageEcosystem == Update.PackageEcosystem && (update.Directory == Update.Directory || update.Directory == Update.Directory+"/") { updateAlreadyExist = true break } diff --git a/remediation/dependabot/dependabotconfig_test.go b/remediation/dependabot/dependabotconfig_test.go index c3f4898d..c4e4f7c7 100644 --- a/remediation/dependabot/dependabotconfig_test.go +++ b/remediation/dependabot/dependabotconfig_test.go @@ -48,6 +48,11 @@ func TestConfigDependabotFile(t *testing.T) { Ecosystems: []Ecosystem{{"npm", "/sample", "daily"}}, isChanged: true, }, + { + fileName: "extra-slash.yml", + Ecosystems: []Ecosystem{{"npm", "/sample", "daily"}}, + isChanged: false, + }, } for _, test := range tests { diff --git a/testfiles/dependabotfiles/input/extra-slash.yml b/testfiles/dependabotfiles/input/extra-slash.yml new file mode 100644 index 00000000..5ab1c551 --- /dev/null +++ b/testfiles/dependabotfiles/input/extra-slash.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "npm" + # Files stored in `app` directory + directory: "/sample/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/testfiles/dependabotfiles/output/extra-slash.yml b/testfiles/dependabotfiles/output/extra-slash.yml new file mode 100644 index 00000000..6f65f32e --- /dev/null +++ b/testfiles/dependabotfiles/output/extra-slash.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "npm" + # Files stored in `app` directory + directory: "/sample/" + schedule: + interval: "daily"