Skip to content

Commit 9cad027

Browse files
check artifact size after download and extraction (microsoft#162407)
* just log it for now * add size check
1 parent bcb6c9b commit 9cad027

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build/azure-pipelines/product-publish.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ do {
7676

7777
$null,$product,$os,$arch,$type = $artifactName -split '_'
7878
$asset = Get-ChildItem -rec "$env:AGENT_TEMPDIRECTORY/$artifactName"
79+
80+
if ($asset.Size -ne $_.resource.properties.artifactsize) {
81+
Write-Warning "Artifact size mismatch for '$artifactName'. Expected: $($_.resource.properties.artifactsize). Actual: $($asset.Size)"
82+
$set.Remove($artifactName) | Out-Null
83+
continue
84+
}
85+
7986
Write-Host "Processing artifact with the following values:"
8087
# turning in into an object just to log nicely
8188
@{

0 commit comments

Comments
 (0)