Skip to content

Commit 33bbe7d

Browse files
authored
Create tasks to collect and publish hashes for build files. (PowerShell#18276)
1 parent 8a45d14 commit 33bbe7d

File tree

1 file changed

+18
-0
lines changed
  • tools/releaseBuild/azureDevOps/templates/compliance

1 file changed

+18
-0
lines changed

tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ jobs:
7878
retryCountOnTaskFailure: 2
7979
workingDirectory: '$(Build.SourcesDirectory)'
8080
81+
- pwsh: |
82+
Get-ChildItem '$(BinDir)' -File |
83+
Foreach-Object {
84+
[pscustomobject]@{
85+
Path = $_.FullName
86+
Version = $_.VersionInfo.FileVersion
87+
Md5Hash = (Get-FileHash -Algorithm MD5 -Path $_.FullName).Hash
88+
Sha512Hash = (Get-FileHash -Algorithm SHA512 -Path $_.FullName).Hash
89+
}
90+
} | Export-Csv -Path '$(Build.SourcesDirectory)/ReleaseFileHash.csv'
91+
displayName: 'Create release file hash artifact'
92+
93+
- task: PublishBuildArtifacts@1
94+
displayName: 'Publish Build File Hash artifact'
95+
inputs:
96+
pathToPublish: '$(Build.SourcesDirectory)/ReleaseFileHash.csv'
97+
artifactName: ReleaseFilesHash
98+
8199
- task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@2
82100
displayName: 'Run APIScan'
83101
inputs:

0 commit comments

Comments
 (0)