From 265fd9a9797b0d8e48089ebd1c49042057373e1a Mon Sep 17 00:00:00 2001 From: Dmitry Zhukovsky Date: Fri, 14 Feb 2025 01:52:36 +0100 Subject: [PATCH 1/3] Refactor dependency check task to use local repository path for sources directory --- Tasks/DependencyCheck/dependency-check-build-task.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/DependencyCheck/dependency-check-build-task.ts b/Tasks/DependencyCheck/dependency-check-build-task.ts index f6b49c3..a7235ae 100644 --- a/Tasks/DependencyCheck/dependency-check-build-task.ts +++ b/Tasks/DependencyCheck/dependency-check-build-task.ts @@ -51,7 +51,7 @@ async function run() { if (localInstallPath !== undefined) localInstallPath = localInstallPath.trim(); if (nvdApiKey !== undefined) nvdApiKey = nvdApiKey.trim(); - const sourcesDirectory = tl.getVariable('Build.SourcesDirectory'); + const sourcesDirectory = tl.getVariable('Build.Repository.LocalPath'); const testDirectory = tl.getVariable('Common.TestResultsDirectory'); // Set reports directory (if necessary) @@ -138,7 +138,7 @@ async function run() { } cleanLocalInstallPath(localInstallPath); - await unzipFromUrl(zipUrl, path.join(localInstallPath, '../')); + await unzipFromUrl(zipUrl, localInstallPath); } // Pull cached data archive From 9096094d8d14cfc46e91c61b38770f95bf290b1f Mon Sep 17 00:00:00 2001 From: Dmitry Zhukovsky Date: Fri, 14 Feb 2025 02:24:58 +0100 Subject: [PATCH 2/3] Remove redundant assignment of localInstallPath in dependency check task --- Tasks/DependencyCheck/dependency-check-build-task.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tasks/DependencyCheck/dependency-check-build-task.ts b/Tasks/DependencyCheck/dependency-check-build-task.ts index a7235ae..aef5f45 100644 --- a/Tasks/DependencyCheck/dependency-check-build-task.ts +++ b/Tasks/DependencyCheck/dependency-check-build-task.ts @@ -124,8 +124,6 @@ async function run() { // Set installation location if (localInstallPath == sourcesDirectory) { hasLocalInstallation = false; - localInstallPath = path.join(__dirname, 'dependency-check'); - tl.checkPath(localInstallPath, 'Dependency Check installer'); let zipUrl: string; From f9a35d5f097be9dbb13b7f31cc03a4c3938c1a56 Mon Sep 17 00:00:00 2001 From: Dmitry Zhukovsky Date: Fri, 14 Feb 2025 02:27:15 +0100 Subject: [PATCH 3/3] Update localInstallPath to include 'dependency-check' directory in unzip process --- Tasks/DependencyCheck/dependency-check-build-task.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tasks/DependencyCheck/dependency-check-build-task.ts b/Tasks/DependencyCheck/dependency-check-build-task.ts index aef5f45..3439eb6 100644 --- a/Tasks/DependencyCheck/dependency-check-build-task.ts +++ b/Tasks/DependencyCheck/dependency-check-build-task.ts @@ -137,6 +137,8 @@ async function run() { cleanLocalInstallPath(localInstallPath); await unzipFromUrl(zipUrl, localInstallPath); + + localInstallPath = path.join(localInstallPath, 'dependency-check'); } // Pull cached data archive