change from name of the package to the package url to avoid conflict between 2 dependencies with the same name but for different ecosystems

This commit is contained in:
Adrien Pessu
2023-08-08 16:34:23 +02:00
parent c462e2e50e
commit 1db9156f85
6 changed files with 34 additions and 30 deletions
+3 -3
View File
@@ -11,11 +11,11 @@ export async function getDeniedChanges(
let failed = false
for (const change of changes) {
change.name = change.name.toLowerCase()
change.package_url = change.package_url.toLowerCase()
const packageUrl = change.package_url.toLowerCase().split('@')[0]
if (deniedPackages) {
for (const denied of deniedPackages) {
if (change.name === denied.toLowerCase()) {
if (packageUrl === denied.split('@')[0].toLowerCase()) {
changesDenied.push(change)
failed = true
}
@@ -24,7 +24,7 @@ export async function getDeniedChanges(
if (deniedGroups) {
for (const denied of deniedGroups) {
if (change.name.startsWith(denied.toLowerCase())) {
if (packageUrl.startsWith(denied.toLowerCase())) {
changesDenied.push(change)
failed = true
}