diff --git a/eng/pipelines/templates/stages/archetype-python-release.yml b/eng/pipelines/templates/stages/archetype-python-release.yml index 8e2a3748f908..916a0fb27a0e 100644 --- a/eng/pipelines/templates/stages/archetype-python-release.yml +++ b/eng/pipelines/templates/stages/archetype-python-release.yml @@ -286,8 +286,8 @@ stages: $packageDirectory = "${{artifact.name}}".Replace("_", "-") echo "##vso[task.setvariable variable=Package.Name]$packageDirectory" - pwsh: | - $fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$packageDirectory -Filter $packageDirectory-[0-9]*.[0-9]*.[0-9]*a[0-9]* | Measure-Object).Count - + $fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}/$(Package.Name) | ? {$_.Name -match "-[0-9]*.[0-9]*.[0-9]*a[0-9]*" } | Measure-Object).Count + if ($fileCount -eq 0) { Write-Host "No alpha packages for ${{artifact.safeName}} to publish." exit 0