@@ -34,46 +34,26 @@ steps:
34
34
customCommand : run test
35
35
verbose : true
36
36
37
- - script : |
38
- pat=$(AZURE_DEVOPS_PERSONAL_PAT)
39
- azBuildId=$(curl -s -u :$pat \
40
- -H "Content-Type: application/json" \
41
- "https://dev.azure.com/nhsuk/nhsuk.utilities/_apis/build/latest/1395?branchName=main&resultFilter=succeeded&statusFilter=completed&api-version=7.1-preview.1" | jq '.id')
42
-
43
- echo "azBuildId" $azBuildId
44
- echo $pat | az devops login --org "https://dev.azure.com/nhsuk/"
45
- az pipelines runs artifact download \
46
- --artifact-name owasp \
47
- --path $(Pipeline.Workspace)/owasp \
48
- --run-id $azBuildId \
49
- --org "https://dev.azure.com/nhsuk/" \
50
- --project nhsuk.utilities
51
-
52
- find $(Pipeline.Workspace)/owasp/ -type f -iname "*.sh" -exec chmod +x {} \;
53
- displayName : ' Install & Login Azure DevOps Extension'
54
-
55
- - task : Bash@3
37
+ - task : dependency-check-build-task@6
38
+ displayName : ' Run OWASP Dependency Check'
56
39
inputs :
57
- filePath : ' $(Pipeline.Workspace)/owasp/run_owasp_scanner.sh'
58
- arguments : ' --scan "$(System.DefaultWorkingDirectory)" --failOnCVSS "7" --project "nhsuk.nhsuk-prototype-kit" --out "$(System.DefaultWorkingDirectory)/dependency-scan-results" --suppression $(System.DefaultWorkingDirectory)/owasp-dependency-check-suppressions.xml --format HTML --format JUNIT --format JSON'
59
- displayName : Run OWASP Dependency Check
40
+ projectName : ' nhsuk-prototype-kit'
41
+ scanPath : ' $(Build.SourcesDirectory)'
42
+ format : ' HTML, JUNIT'
43
+ reportsDirectory : ' $(System.DefaultWorkingDirectory)/dependency-scan-results'
44
+ dependencyCheckVersion : ' 8.4.3'
60
45
61
46
- task : PublishTestResults@2
62
47
displayName : ' Publish OWASP Dependency Check Results'
63
- condition : succeededOrFailed()
64
48
inputs :
65
49
testResultsFormat : ' JUnit'
66
- testResultsFiles : ' $(System.DefaultWorkingDirectory)/dependency-scan-results/dependency-check- junit.xml'
50
+ testResultsFiles : ' $(System.DefaultWorkingDirectory)/dependency-scan-results/* junit.xml'
67
51
testRunTitle : ' Dependency check'
68
-
69
- - task : PublishBuildArtifacts@1
70
- displayName : Publish Owasp Artifact
71
- condition : succeededOrFailed()
72
- inputs :
73
- ArtifactName : Owasp
74
- TargetPath : ' $(System.DefaultWorkingDirectory)/dependency-scan-results/'
52
+ searchFolder : ' $(Common.TestResultsDirectory)'
75
53
76
54
- task : SonarCloudAnalyze@1
55
+ inputs :
56
+ jdkversion : ' JAVA_HOME_17_X64'
77
57
displayName : ' Run SonarCloud Code Analysis'
78
58
79
59
- task : SonarCloudPublish@1
0 commit comments