diff --git a/Tasks/DependencyCheck/dependency-check-build-task.ts b/Tasks/DependencyCheck/dependency-check-build-task.ts index 4f764bd..f6b49c3 100644 --- a/Tasks/DependencyCheck/dependency-check-build-task.ts +++ b/Tasks/DependencyCheck/dependency-check-build-task.ts @@ -1,7 +1,6 @@ import tl = require('azure-pipelines-task-lib/task'); import httpClient = require('typed-rest-client/HttpClient'); import fs = require('fs'); -import url = require('url'); import path = require('path'); import decompress from 'decompress'; import { IHttpClientResponse } from 'typed-rest-client/Interfaces'; @@ -125,7 +124,7 @@ async function run() { // Set installation location if (localInstallPath == sourcesDirectory) { hasLocalInstallation = false; - localInstallPath = tl.resolve('./dependency-check'); + localInstallPath = path.join(__dirname, 'dependency-check'); tl.checkPath(localInstallPath, 'Dependency Check installer'); @@ -139,7 +138,7 @@ async function run() { } cleanLocalInstallPath(localInstallPath); - await unzipFromUrl(zipUrl, tl.resolve('./')); + await unzipFromUrl(zipUrl, path.join(localInstallPath, '../')); } // Pull cached data archive @@ -319,7 +318,7 @@ function maskArguments(args: string): string { } async function unzipFromUrl(zipUrl: string, unzipLocation: string): Promise { - const fileName = path.basename(url.parse(zipUrl).pathname); + const fileName = path.basename(new URL(zipUrl).pathname); const zipLocation = tl.resolve(fileName) let tmpError = null; let response: IHttpClientResponse = null; diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8b075ed..a28ef2d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,11 +6,17 @@ trigger: - refs/heads/hotfix/* - refs/tags/* +parameters: + - name: variable_group_name + displayName: Variable Group + type: string + default: 'DependencyCheck-AzureDevOps' + pool: vmImage: 'ubuntu-latest' variables: - - group: DependencyCheck-AzureDevOps + - group: ${{ parameters.variable_group_name }} - name: CurrentDate value: $[ format('{0:yyyy}{0:MM}{0:dd}', pipeline.startTime) ] - name: PublishEnvironment @@ -20,6 +26,9 @@ variables: value: 'Development' ${{ if startsWith( variables['Build.SourceBranch'], 'refs/heads/hotfix/' ) }}: value: 'Hotfix' + ${{ else }}: + value: 'Development' + stages: - stage: 'buildStage' diff --git a/package-lock.json b/package-lock.json index 5c6b16f..73e6446 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,11 +32,11 @@ "eslint-plugin-no-null": "^1.0.2", "fs-extra": "^11.2.0", "glob": "^10.3.10", - "mocha": "^10.2.0", + "mocha": "^10.4.0", "semver": "^7.5.4", "shelljs": "^0.8.5", "terser-webpack-plugin": "^5.3.10", - "tfx-cli": "^0.16.0", + "tfx-cli": "^0.17.0", "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "typescript": "^5.4.4", @@ -8231,9 +8231,9 @@ "dev": true }, "node_modules/tfx-cli": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.16.0.tgz", - "integrity": "sha512-kWRIvZiHWqpaCnHmXmJ/+Bzegiaf+q1+lkG0ht2+REW7qmQDaRMgeMeCiQCk0UDudQN1cPhPJSalzy3BwwxGuA==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.17.0.tgz", + "integrity": "sha512-/fFD1qE3FkPglQQZIxbiZ2Hl5itTgLQW1LJ/2qMxGYkzxJx9U/axhg/g6dnYb2qsvWs4oHTbajHCiLKe8mE5LA==", "dev": true, "dependencies": { "app-root-path": "1.0.0", diff --git a/package.json b/package.json index ac73525..4d2d59e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "semver": "^7.5.4", "shelljs": "^0.8.5", "terser-webpack-plugin": "^5.3.10", - "tfx-cli": "^0.16.0", + "tfx-cli": "^0.17.0", "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "typescript": "^5.4.4", @@ -58,7 +58,7 @@ "webpack-cli": "^5.1.4", "webpack-node-externals": "^3.0.0", "yargs": "^17.7.2", - "mocha": "^10.2.0", + "mocha": "^10.4.0", "assert": "^2.1.0" } }