From b9929dd6da71023317315d2e3c8b6c49c4c75eac Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Mon, 25 Mar 2024 15:02:21 +0800 Subject: [PATCH] Update VSCode-Spring-Boot-Dashboard-Nightly.yml to enable api scan --- .azp/VSCode-Spring-Boot-Dashboard-Nightly.yml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.azp/VSCode-Spring-Boot-Dashboard-Nightly.yml b/.azp/VSCode-Spring-Boot-Dashboard-Nightly.yml index 8b03421..3b5cc8f 100644 --- a/.azp/VSCode-Spring-Boot-Dashboard-Nightly.yml +++ b/.azp/VSCode-Spring-Boot-Dashboard-Nightly.yml @@ -22,9 +22,9 @@ extends: template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: pool: - os: linux name: 1ES_JavaTooling_Pool - image: 1ES_JavaTooling_Ubuntu-2004 + image: 1ES_JavaTooling_Windows_2022 + os: windows sdl: sourceAnalysisPool: name: 1ES_JavaTooling_Pool @@ -71,7 +71,7 @@ extends: - task: CmdLine@2 displayName: Replace AI Key inputs: - script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\"" + script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"%AI_KEY%\"" - bash: | npx json@latest -I -f package.json -e "this.version=this.version.substring(0, this.version.lastIndexOf('.'))+\".$(date -u +'%Y%m%d%H')\"" displayName: Update patch version in package.json @@ -86,6 +86,25 @@ extends: command: custom verbose: false customCommand: run test + ### Copy files for APIScan + - task: CopyFiles@2 + displayName: "Copy Files for APIScan" + inputs: + Contents: "*.vsix" + TargetFolder: $(Agent.TempDirectory)/APIScanFiles + condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true')) + ### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task + - task: APIScan@2 + displayName: Run APIScan + inputs: + softwareFolder: $(Agent.TempDirectory)/APIScanFiles + softwareName: "vscode-spring-boot-dashboard" + softwareVersionNum: "$(Build.BuildId)" + isLargeApp: false + toolVersion: "Latest" + condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true')) + env: + AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret) - task: CopyFiles@2 displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)' inputs: