Skip to content

Commit

Permalink
Merge pull request #311 from SkillsFundingAgency/DASD-9787-set-app-bu…
Browse files Browse the repository at this point in the history
…ild-yml-builds-to-fail-build-if-package-scanning-step-finds-vulnerabilities

Parameterized continueOnError and set it to false
  • Loading branch information
debrr07 authored Mar 30, 2023
2 parents b51fd42 + 3de86ec commit e6747a2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions azure-pipelines-templates/build/step/app-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
TargetProjects: 'src/**/*.csproj'
UnitTestProjects: '**/*UnitTests.csproj'
AcceptanceTestProjects: '**/*.AcceptanceTests.csproj'
ContinueOnVulnerablePackageScanError: false

steps:
- task: SonarCloudPrepare@1
Expand Down Expand Up @@ -50,16 +51,18 @@ steps:
}
}
}
if($ErrorFound){
Write-Host "##vso[task.logissue type=warning]Package issues discovered, review output above"
Write-Output "##vso[task.setvariable variable=VulnerablePackagesDetected;isreadonly=true]true"
$(exit 1)
} else {
Write-Host "##vso[task.logissue type=warning]Package issues discovered, review output above"
Write-Output "##vso[task.setvariable variable=VulnerablePackagesDetected;isreadonly=true]true"
$(exit 1)
}
else {
Write-Output "##vso[task.setvariable variable=VulnerablePackagesDetected;isreadonly=true]false"
$(exit 0)
$(exit 0)
}
displayName: Package Scanning
continueOnError: true
continueOnError: ${{ parameters.ContinueOnVulnerablePackageScanError }}

- task: DownloadSecureFile@1
name: DownloadDasGitHubAppPrivateKey
Expand Down

0 comments on commit e6747a2

Please sign in to comment.